2016-05-27 10:01:14 +02:00
|
|
|
Benchmarking
|
|
|
|
============
|
|
|
|
|
|
|
|
Bitcoin Core has an internal benchmarking framework, with benchmarks
|
2019-08-02 18:11:04 +02:00
|
|
|
for cryptographic algorithms (e.g. SHA1, SHA256, SHA512, RIPEMD160, Poly1305, ChaCha20), rolling bloom filter, coins selection,
|
|
|
|
thread queue, wallet balance.
|
2016-05-27 10:01:14 +02:00
|
|
|
|
2018-01-15 02:53:41 +01:00
|
|
|
Running
|
|
|
|
---------------------
|
2019-08-02 18:11:04 +02:00
|
|
|
|
|
|
|
For benchmarks purposes you only need to compile `bitcoin_bench`. Beware of configuring without `--enable-debug` as this would impact
|
|
|
|
benchmarking by unlatching log printers and lock analysis.
|
|
|
|
|
2019-10-08 22:14:01 +02:00
|
|
|
make -C src bitcoin_bench
|
2019-08-02 18:11:04 +02:00
|
|
|
|
2016-05-27 10:01:14 +02:00
|
|
|
After compiling bitcoin-core, the benchmarks can be run with:
|
2018-01-15 02:53:41 +01:00
|
|
|
|
|
|
|
src/bench/bench_bitcoin
|
2016-05-27 10:01:14 +02:00
|
|
|
|
|
|
|
The output will look similar to:
|
|
|
|
```
|
2018-01-15 02:53:41 +01:00
|
|
|
# Benchmark, evals, iterations, total, min, max, median
|
2019-08-02 18:11:04 +02:00
|
|
|
AssembleBlock, 5, 700, 1.79954, 0.000510913, 0.000517018, 0.000514497
|
|
|
|
...
|
2016-05-27 10:01:14 +02:00
|
|
|
```
|
|
|
|
|
2018-01-15 02:53:41 +01:00
|
|
|
Help
|
|
|
|
---------------------
|
|
|
|
|
2019-08-02 18:11:04 +02:00
|
|
|
src/bench/bench_bitcoin --help
|
|
|
|
|
|
|
|
To print options like scaling factor or per-benchmark filter.
|
2018-01-15 02:53:41 +01:00
|
|
|
|
|
|
|
Notes
|
|
|
|
---------------------
|
2016-05-27 10:01:14 +02:00
|
|
|
More benchmarks are needed for, in no particular order:
|
|
|
|
- Script Validation
|
|
|
|
- Coins database
|
|
|
|
- Memory pool
|
2019-08-02 18:11:04 +02:00
|
|
|
- Cuckoo Cache
|
|
|
|
- P2P throughput
|
|
|
|
|
|
|
|
Going Further
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
To monitor Bitcoin Core performance more in depth (like reindex or IBD): https://github.com/chaincodelabs/bitcoinperf
|
|
|
|
|
|
|
|
To generate Flame Graphs for Bitcoin Core: https://github.com/eklitzke/bitcoin/blob/flamegraphs/doc/flamegraphs.md
|