2016-05-31 15:18:35 +02:00
|
|
|
Benchmarking
|
|
|
|
============
|
|
|
|
|
2017-12-22 06:09:04 +01:00
|
|
|
Dash Core has an internal benchmarking framework, with benchmarks
|
2019-08-05 13:53:42 +02:00
|
|
|
for cryptographic algorithms (e.g. SHA1, SHA256, SHA512, RIPEMD160, Poly1305, ChaCha20), rolling bloom filter, coins selection,
|
|
|
|
thread queue, wallet balance.
|
2016-05-31 15:18:35 +02:00
|
|
|
|
2018-01-22 14:44:31 +01:00
|
|
|
Running
|
|
|
|
---------------------
|
2019-08-05 13:53:42 +02:00
|
|
|
|
2021-07-05 02:47:10 +02:00
|
|
|
For benchmarking, you only need to compile `dash_bench`. The bench runner
|
|
|
|
warns if you configure with `--enable-debug`, but consider if building without
|
|
|
|
it will impact the benchmark(s) you are interested in by unlatching log printers
|
|
|
|
and lock analysis.
|
2019-08-05 13:53:42 +02:00
|
|
|
|
2019-10-09 15:40:39 +02:00
|
|
|
make -C src dash_bench
|
2019-08-05 13:53:42 +02:00
|
|
|
|
2018-01-16 08:29:17 +01:00
|
|
|
After compiling Dash Core, the benchmarks can be run with:
|
2018-01-22 14:44:31 +01:00
|
|
|
|
|
|
|
src/bench/bench_dash
|
2016-05-31 15:18:35 +02:00
|
|
|
|
|
|
|
The output will look similar to:
|
|
|
|
```
|
2021-07-05 02:47:10 +02:00
|
|
|
| ns/op | op/s | err% | total | benchmark
|
|
|
|
|--------------------:|--------------------:|--------:|----------:|:----------
|
|
|
|
| 57,927,463.00 | 17.26 | 3.6% | 0.66 | `AddrManAdd`
|
|
|
|
| 677,816.00 | 1,475.33 | 4.9% | 0.01 | `AddrManGetAddr`
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
| ns/byte | byte/s | err% | total | benchmark
|
|
|
|
|--------------------:|--------------------:|--------:|----------:|:----------
|
|
|
|
| 127.32 | 7,854,302.69 | 0.3% | 0.00 | `Base58CheckEncode`
|
|
|
|
| 31.95 | 31,303,226.99 | 0.2% | 0.00 | `Base58Decode`
|
|
|
|
|
2021-06-26 12:03:16 +02:00
|
|
|
...
|
2016-05-31 15:18:35 +02:00
|
|
|
```
|
|
|
|
|
2018-01-22 14:44:31 +01:00
|
|
|
Help
|
|
|
|
---------------------
|
|
|
|
|
2021-07-05 02:47:10 +02:00
|
|
|
src/bench/bench_dash -?
|
2019-08-05 13:53:42 +02:00
|
|
|
|
2021-07-05 02:47:10 +02:00
|
|
|
To print the various options, like listing the benchmarks without running them
|
|
|
|
or using a regex filter to only run certain benchmarks.
|
2018-01-22 14:44:31 +01:00
|
|
|
|
|
|
|
Notes
|
|
|
|
---------------------
|
2016-05-31 15:18:35 +02:00
|
|
|
More benchmarks are needed for, in no particular order:
|
|
|
|
- Script Validation
|
|
|
|
- Coins database
|
|
|
|
- Memory pool
|
2019-08-05 13:53:42 +02:00
|
|
|
- Cuckoo Cache
|
|
|
|
- P2P throughput
|
|
|
|
|
|
|
|
Going Further
|
|
|
|
--------------------
|
|
|
|
|
2022-04-19 08:09:42 +02:00
|
|
|
To monitor Dash Core performance more in depth (like reindex or IBD): https://github.com/chaincodelabs/bitcoinperf
|
2019-08-05 13:53:42 +02:00
|
|
|
|
2022-04-19 08:09:42 +02:00
|
|
|
To generate Flame Graphs for Dash Core: https://github.com/eklitzke/bitcoin/blob/flamegraphs/doc/flamegraphs.md
|