bitcoin/src/bench
fanquake 5abbc9afec
Merge bitcoin/bitcoin#24832: index: Verify the block filter hash when reading the filter from disk.
e734228d85 Update GCSFilter benchmarks (Calvin Kim)
aee9a8140b Add GCSFilterDecodeSkipCheck benchmark (Patrick Strateman)
299023c1d9 Add GCSFilterDecode and GCSBlockFilterGetHash benchmarks. (Patrick Strateman)
b0a53d50d9 Make sanity check in GCSFilter constructor optional (Patrick Strateman)

Pull request description:

  This PR picks up the abandoned #19280

  BlockFilterIndex was depending on `GolombRiceDecode()` during the filter decode to sanity check that the filter wasn't corrupt. However, we can check for corruption by ensuring that the encoded blockfilter's hash matches up with the one stored in the index database.

  Benchmarks that were added in #19280 showed that checking the hash is much faster.

  The benchmarks were changed to nanobench and the relevant benchmarks were like below, showing a clear win for the hash check method.

  ```
  |             ns/elem |              elem/s |    err% |        ins/elem |       bra/elem |   miss% |     total | benchmark
  |--------------------:|--------------------:|--------:|----------------:|---------------:|--------:|----------:|:----------
  |              531.40 |        1,881,819.43 |    0.3% |        3,527.01 |         411.00 |    0.2% |      0.01 | `DecodeCheckedGCSFilter`
  |          258,220.50 |            3,872.66 |    0.1% |    2,990,092.00 |     586,706.00 |    1.7% |      0.01 | `DecodeGCSFilter`
  |           13,036.77 |           76,706.09 |    0.3% |       64,238.24 |         513.04 |    0.2% |      0.01 | `BlockFilterGetHash`
  ```

ACKs for top commit:
  mzumsande:
    Code Review ACK e734228d85
  theStack:
    Code-review ACK e734228d85
  stickies-v:
    ACK e734228d85
  ryanofsky:
    Code review ACK e734228d85, with caveat that I mostly paid attention to the main code, not the changes to the benchmark. Only changes since last review were changes to the benchmark code.

Tree-SHA512: 02b86eab7b554e1a57a15b17a4d6d71faa91b556c637b0da29f0c9ee76597a110be8e3b4d0c158d4cab04af0623de18b764837be0ec2a72afcfe1ad9c78a83c6
2022-07-07 17:59:02 +01:00
..
data Add deserialize + CheckBlock benchmarks, and a full block hex 2016-11-09 11:27:59 -08:00
.gitignore Ignore bench_bitcoin binary. 2015-10-06 17:46:12 +02:00
addrman.cpp [net] Move asmap into NetGroupManager 2022-04-20 14:29:29 +01:00
base58.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
bech32.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
bench.cpp Fixup option name in bench message 2022-05-25 00:26:38 -05:00
bench.h bench: Add --sanity-check flag, use it in make check 2022-05-17 11:32:25 +02:00
bench_bitcoin.cpp bench: Make all arguments -kebab-case 2022-05-17 11:32:25 +02:00
block_assemble.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
ccoins_caching.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
chacha20.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
chacha_poly_aead.cpp Do not run functions with necessary side-effects in assert() 2020-12-06 00:48:09 +00:00
checkblock.cpp Use spans of std::byte in serialize 2022-01-02 11:40:31 +01:00
checkqueue.cpp refactor: use C++11 default initializers 2022-05-17 17:18:58 +01:00
coin_selection.cpp Set effective_value when initializing a COutput 2022-05-21 11:25:54 -04:00
crypto_hash.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
data.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
data.h bench: Move generated data to a dedicated translation unit 2019-07-02 18:11:15 +01:00
duplicate_inputs.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
examples.cpp bench: Avoid deprecated use of volatile += 2022-02-17 17:25:57 +01:00
gcs_filter.cpp Update GCSFilter benchmarks 2022-05-22 14:17:15 +09:00
hashpadding.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
lockedpool.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
logging.cpp bench: Add logging benchmark 2021-12-15 14:33:59 +01:00
mempool_eviction.cpp bench: Use existing CTxMemPool in TestingSetup 2022-06-15 17:28:55 -04:00
mempool_stress.cpp use testing setup mempool in ComplexMemPool bench 2022-05-30 16:00:41 -07:00
merkle_root.cpp Replace current benchmarking framework with nanobench 2020-06-13 12:24:18 +02:00
nanobench.cpp Replace current benchmarking framework with nanobench 2020-06-13 12:24:18 +02:00
nanobench.h bench: update nanobench from 4.3.4 to 4.3.6 2021-09-21 11:46:01 +02:00
peer_eviction.cpp scripted-diff: Rename touched member variables 2021-12-13 13:32:08 +01:00
poly1305.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
prevector.cpp refactor: use C++11 default initializers 2022-05-17 17:18:58 +01:00
rollingbloom.cpp refactor: Remove deduplication of data in rollingbloom bench 2022-04-06 13:57:31 +01:00
rpc_blockchain.cpp move-mostly: Make fHavePruned a BlockMan member 2022-04-19 14:34:56 -04:00
rpc_mempool.cpp bench/rpc_mempool: Create ChainTestingSetup, use its CTxMemPool 2022-06-15 17:28:55 -04:00
strencodings.cpp bench: Adds a benchmark for HexStr 2022-04-17 14:29:52 +02:00
util_time.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
verify_script.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
wallet_balance.cpp refactor: fix clang-tidy named args usage 2022-04-04 09:01:19 +01:00
wallet_loading.cpp bench: Enable loading benchmarks depending on what's compiled 2022-05-10 11:54:02 -04:00