Commit Graph

7 Commits

Author SHA1 Message Date
Jeremy Rubin 7e1cebe44f Add Basic CheckQueue Benchmark 2020-01-22 21:41:28 +00:00
Wladimir J. van der Laan 2561e2664d bench: Add support for measuring CPU cycles
This adds cycle min/max/avg to the statistics.

Supported on x86 and x86_64 (natively through rdtsc), as well as Linux
(perf syscall).
2020-01-22 21:41:28 +00:00
Yuri Zhykin 9585d5a64f bench: Added base58 encoding/decoding benchmarks 2020-01-22 21:40:38 +00:00
Wladimir J. van der Laan 6daf01e402 bench: Add crypto hash benchmarks
Add benchmarks for the cryptographic hash algorithms:

- RIPEMD160
- SHA1
- SHA256
- SHA512

Continues work on #7883.
2020-01-22 21:40:38 +00:00
Pieter Wuille 3161960fc2 Benchmark rolling bloom filter 2020-01-22 21:40:38 +00:00
Gavin Andresen a81da44a8f Support very-fast-running benchmarks
Avoid calling gettimeofday every time through the benchmarking loop, by keeping
track of how long each loop takes and doubling the number of iterations done
between time checks when they take less than 1/16'th of the total elapsed time.
2020-01-22 21:40:38 +00:00
Gavin Andresen d7a20b6373 Simple benchmarking framework
Benchmarking framework, loosely based on google's micro-benchmarking
library (https://github.com/google/benchmark)

Wny not use the Google Benchmark framework? Because adding Even More Dependencies
isn't worth it. If we get a dozen or three benchmarks and need nanosecond-accurate
timings of threaded code then switching to the full-blown Google Benchmark library
should be considered.

The benchmark framework is hard-coded to run each benchmark for one wall-clock second,
and then spits out .csv-format timing information to stdout. It is left as an
exercise for later (or maybe never) to add command-line arguments to specify which
benchmark(s) to run, how long to run them for, how to format results, etc etc etc.
Again, see the Google Benchmark framework for where that might end up.

See src/bench/MilliSleep.cpp for a sanity-test benchmark that just benchmarks
'sleep 100 milliseconds.'

To compile and run benchmarks:
  cd src; make bench

Sample output:

Benchmark,count,min,max,average
Sleep100ms,10,0.101854,0.105059,0.103881
2020-01-22 21:40:35 +00:00