Bench: Added a more complex test to rpc_mempool.cpp
Summary
See issue #51 . I need this more sophisticated benchmark to be in place before
I start issuing my UniValue
optimization MR's, so that reviewers have this test
in place both on master
as well as my MR branch(es), so they can quickly switch
between the two to review the effects of an optimization.
The previous test would only create a mempool of 1k tx's each with 1 in and 1 out.
This new benchmark test will create a mempool of 10k tx's each with 10 ins and 10 outs. This
increased complexity is a better way to test the UniValue
library (among other things).
So now, by default this new more complex benchmark now will take ~21 seconds on my system to execute.
When the new optimizations that are being prepared are in place, that number will drop down to the expected 5 (all the other tests take 5 seconds on my system to execute, give or take 1 second).
Note we need this in place in master before my upcoming changes to UniValue to make testing easier -- you can switch between master and my patches to characterize the effects of MR's I plan on submitting.
Test Plan
ninja src/bench/bitcoin-bench
src/bench/bitcoin-bench -filter=RpcMem.\*
You should notice 2 tests, the old one "RpcMempool" and a new one "RpcMempool10k" whcih should take significantly longer than the simple old one.