mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 05:23:01 +01:00
0d1c8f914c
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 |
||
---|---|---|
.. | ||
data | ||
.gitignore | ||
base58.cpp | ||
bech32.cpp | ||
bench_dash.cpp | ||
bench.cpp | ||
bench.h | ||
block_assemble.cpp | ||
bls_dkg.cpp | ||
bls.cpp | ||
ccoins_caching.cpp | ||
chacha20.cpp | ||
chacha_poly_aead.cpp | ||
checkblock.cpp | ||
checkqueue.cpp | ||
coin_selection.cpp | ||
crypto_hash.cpp | ||
data.cpp | ||
data.h | ||
duplicate_inputs.cpp | ||
ecdsa.cpp | ||
examples.cpp | ||
gcs_filter.cpp | ||
hashpadding.cpp | ||
lockedpool.cpp | ||
mempool_eviction.cpp | ||
mempool_stress.cpp | ||
merkle_root.cpp | ||
nanobench.cpp | ||
nanobench.h | ||
poly1305.cpp | ||
prevector.cpp | ||
rollingbloom.cpp | ||
rpc_mempool.cpp | ||
string_cast.cpp | ||
util_time.cpp | ||
wallet_balance.cpp |