Skip to content

Add 32MB block versions of existing 1MB block benchmarks

This makes the following changes to the available benchmarks:

  • Renames DeserializeBlockTest to DeserializeBlockTest_1MB and adds DeserializeBlockTest_32MB.
  • Renames DeserializeAndCheckBlockTest to DeserializeAndCheckBlockTest_1MB and adds DeserializeAndCheckBlockTest_32MB.
  • Renames BlockToJsonVerbose to BlockToJsonVerbose_1MB and adds BlockToJsonVerbose_32MB.
  • Renames JsonReadWrite1MBBlock to JsonReadWriteBlock_1MB and adds JsonReadWriteBlock_32MB.

Mainnet block 556034 (hash 000000000000000000eb279368d5e158e5ef011010c98da89245f176e2083d64) is used as the 32MB block for the new benchmarks. The 1MB block still is mainnet block 413567 (0000000000000000025aff8be8a55df8f89c77296db6198f272d6577325d4069), as before.

convert-raw-files.py is changed to make large data files digestible for the compiler/linker; specifically, it uses a string literal instead of an initializer list. Previously, the 1MB raw block file turned into a 5MB cpp file, and the 32MB raw block file turned into a 160MB generated cpp file - the latter needs more than 7GB memory to compile and crashes my computer due to running out of memory. Now, the 1MB raw block file turns into a 2.6MB cpp file, and the 32MB raw block file turns into a 83.0MB cpp file, both of which compile and link fine.

Together with !120 (merged), this replaces !104 (closed).

Test plan:

  1. Run convert-raw-files.py (in src/bench/data) and verify the output files are as committed
  2. ninja bench_bitcoin
  3. src/bench/bench_bitcoin -evals=1 - note that DeserializeAndCheckBlockTest asserts that the blocks are valid (so block data is encoded correctly)
Edited by BigBlockIfTrue

Merge request reports

Loading