dash/doc/benchmarking.md
fanquake b71e6fd8b6 Merge #17081: doc: fix Makefile target in benchmarking.md
a54ab2104c82c41d17ca603999a9a03161eefc9e [doc] fix Makefile target in benchmarking.md (Sebastian Falbesoner)

Pull request description:

  While the resulting binary is called `bench_bitcoin`, the Makefile target is
  named `bitcoin_bench` (see `src/Makefile.bench.include`)

ACKs for top commit:
  fanquake:
    ACK a54ab2104c82c41d17ca603999a9a03161eefc9e - Tested on macOS and Debian 9.9, as this only [seemed to work there](https://github.com/bitcoin/bitcoin/pull/16536#discussion_r310366868) when these docs were added.

Tree-SHA512: bcf8d48ccba488f0533111a3be57ddc6c948b3a38beed129635e1c7e0b4608bc9ddf625e8469606bb31d4cedf3341c443564a197d6b1ab5268a9ed44ed5018a3
2022-05-17 01:20:21 -04:00

1.5 KiB

Benchmarking

Dash Core has an internal benchmarking framework, with benchmarks for cryptographic algorithms (e.g. SHA1, SHA256, SHA512, RIPEMD160, Poly1305, ChaCha20), rolling bloom filter, coins selection, thread queue, wallet balance.

Running

For benchmarks purposes you only need to compile dash_bench. Beware of configuring without --enable-debug as this would impact benchmarking by unlatching log printers and lock analysis.

make -C src dash_bench

After compiling Dash Core, the benchmarks can be run with:

src/bench/bench_dash

The output will look similar to:

|             ns/byte |              byte/s | error % | benchmark
|--------------------:|--------------------:|--------:|:----------------------------------------------
|               64.13 |       15,592,356.01 |    0.1% | `Base58CheckEncode`
|               24.56 |       40,722,672.68 |    0.2% | `Base58Decode`
...

Help

src/bench/bench_dash --help

To print options like scaling factor or per-benchmark filter.

Notes

More benchmarks are needed for, in no particular order:

  • Script Validation
  • Coins database
  • Memory pool
  • Cuckoo Cache
  • P2P throughput

Going Further

To monitor Dash Core performance more in depth (like reindex or IBD): https://github.com/chaincodelabs/bitcoinperf

To generate Flame Graphs for Dash Core: https://github.com/eklitzke/bitcoin/blob/flamegraphs/doc/flamegraphs.md