dash/src/bench
MarcoFalke 0d1c8f914c Merge bitcoin/bitcoin#22856: test: Fix bug in transaction generation in ComplexMempool benchmark
29e983386b0aecf99cdb7d0e08ba6b450bed313e Fixes Bug in Transaction generation in ComplexMempool benchmark (Shorya)

Pull request description:

  This fixes issues with `ComplexMempool` benchmark introduced in [#17292](https://github.com/bitcoin/bitcoin/pull/17292) , this stress test benchmarks performance of ancestor and descendant tracking of mempool graph algorithms on a complex Mempool.

  This Benchmark first creates 100 base transactions and stores them in `available_coins` vector. `available_coins` is used for selecting ancestor transactions while creating 800 new transactions. For this a random transaction is picked from `available_coins` and some of its outputs are mapped to the inputs of the new transaction being created.

  Now in case we exhaust all the outputs of an entry in `available_coins` then we need to remove it from `available_coins` before the next iteration of choosing a potential ancestor , it is now implemented with this patch.

   As the index of the entry is randomly chosen from `available_coins` , In order to remove it from the vector , if index of the selected entry is not at the end of `available_coins` vector , it is swapped with the entry at the back of the vector , then the entry at the end of `available_coins` is popped out.

  Earlier the code responsible for constructing outputs of the newly created transaction was inside the loop used for assigning ancestors to the transaction , which does some unnecessary work as it creates outputs of the transaction again and again , now it is moved out of the loop so outputs of the transaction are created just once before adding it to the final list of the transactions created. This one is a minor change to save some computation.

   These changes have changed the `ComplexMempool` benchmark results on `bitcoin:master` as follows :

  **Before**

  >
  |               ns/op |                op/s |    err% |     total | benchmark
  |--------------------:|--------------------:|--------:|----------:|:----------
  |      232,881,625.00 |                4.29 |    0.7% |      2.55 | `ComplexMemPool`

  **After**

  >
  |               ns/op |                op/s |    err% |     total | benchmark
  |--------------------:|--------------------:|--------:|----------:|:----------
  |      497,275,135.00 |                2.01 |    0.5% |      5.49 | `ComplexMemPool`

Top commit has no ACKs.

Tree-SHA512: d6946d7e65c55f54c84cc49d7abee52e59ffc8b7668b3c80b4ce15a57690ab00a600c6241cc71a2a075def9c30792a311256fed325ef162f37aeacd2cce93624
2022-04-11 09:41:11 -07:00
..
data Fix DeserializeAndCheckBlockTest benchmark and store hashDevnetGenesisBlock in consensus (#1888) 2018-02-01 20:05:35 +03:00
.gitignore more bitcoin->dash 2016-03-04 12:09:03 +03:00
base58.cpp 16659 continuation 2021-12-17 12:02:16 -05:00
bech32.cpp 16659 continuation 2021-12-17 12:02:16 -05:00
bench_dash.cpp merge bitcoin#17279: Remove redundant c_str() calls in formatting 2022-04-06 13:51:39 +05:30
bench.cpp Merge #16975: test: Show debug log on unit test failure 2022-04-03 08:35:45 +05:30
bench.h Merge #16659: refactoring: Remove unused includes 2021-12-12 16:44:54 -05:00
block_assemble.cpp 16659 continuation 2021-12-17 12:02:16 -05:00
bls_dkg.cpp refactor: Fix warnings from cppcheck (#4625) 2021-12-29 00:54:50 +03:00
bls.cpp refactor: Fix warnings from cppcheck (#4625) 2021-12-29 00:54:50 +03:00
ccoins_caching.cpp merge bitcoin#14908: Removed implicit CTransaction constructor calls from tests and benchmark 2021-10-12 08:58:08 +05:30
chacha20.cpp 16659 continuation 2021-12-17 12:02:16 -05:00
chacha_poly_aead.cpp Merge #16659: refactoring: Remove unused includes 2021-12-12 16:44:54 -05:00
checkblock.cpp merge bitcoin#16299: Move generated data to a dedicated translation unit 2021-12-12 22:36:50 +05:30
checkqueue.cpp 16659 continuation 2021-12-17 12:02:16 -05:00
coin_selection.cpp merge bitcoin#19310: BerkeleyDatabase make BerkeleyDatabase::Create, CreateMock, and CreateDummy non-static functions 2022-03-06 12:30:58 +05:30
crypto_hash.cpp merge #18011: Replace current benchmarking framework with nanobench 2021-07-05 18:28:55 +05:30
data.cpp merge bitcoin#16299: Move generated data to a dedicated translation unit 2021-12-12 22:36:50 +05:30
data.h merge bitcoin#16299: Move generated data to a dedicated translation unit 2021-12-12 22:36:50 +05:30
duplicate_inputs.cpp 16659 continuation 2021-12-17 12:02:16 -05:00
ecdsa.cpp merge #18011: Replace current benchmarking framework with nanobench 2021-07-05 18:28:55 +05:30
examples.cpp 16659 continuation 2021-12-17 12:02:16 -05:00
gcs_filter.cpp bitcoin#14172: Refactor and add tests for BlockFilter construction 2021-08-12 12:44:02 +05:30
hashpadding.cpp merge bitcoin#13204: Faster sigcache nonce 2022-02-26 10:47:54 +05:30
lockedpool.cpp Merge #16659: refactoring: Remove unused includes 2021-12-12 16:44:54 -05:00
mempool_eviction.cpp Merge #16659: refactoring: Remove unused includes 2021-12-12 16:44:54 -05:00
mempool_stress.cpp Merge bitcoin/bitcoin#22856: test: Fix bug in transaction generation in ComplexMempool benchmark 2022-04-11 09:41:11 -07:00
merkle_root.cpp merge #18011: Replace current benchmarking framework with nanobench 2021-07-05 18:28:55 +05:30
nanobench.cpp merge #18011: Replace current benchmarking framework with nanobench 2021-07-05 18:28:55 +05:30
nanobench.h merge #18011: Replace current benchmarking framework with nanobench 2021-07-05 18:28:55 +05:30
poly1305.cpp Merge #16659: refactoring: Remove unused includes 2021-12-12 16:44:54 -05:00
prevector.cpp Partial Merge #20491: refactor: Drop noop gcc version checks 2021-10-11 17:17:24 -05:00
rollingbloom.cpp Merge #16659: refactoring: Remove unused includes 2021-12-12 16:44:54 -05:00
rpc_mempool.cpp Merge #16129: refactor: Remove unused includes (#4623) 2022-01-03 13:10:02 -06:00
string_cast.cpp fix: resolve numerous compilation warnings under -Wall (#4599) 2021-12-01 22:59:34 +03:00
util_time.cpp merge #18011: Replace current benchmarking framework with nanobench 2021-07-05 18:28:55 +05:30
wallet_balance.cpp merge bitcoin#19310: BerkeleyDatabase make BerkeleyDatabase::Create, CreateMock, and CreateDummy non-static functions 2022-03-06 12:30:58 +05:30