aboutsummaryrefslogtreecommitdiff
path: root/src/bench
AgeCommit message (Collapse)Author
2016-05-31Merge #8115: Avoid integer division in the benchmark inner-most loop.Wladimir J. van der Laan
63ff57d Avoid integer division in the benchmark inner-most loop. (Gregory Maxwell)
2016-05-30Avoid integer division in the benchmark inner-most loop.Gregory Maxwell
Previously the benchmark code used an integer division (%) with a non-constant in the inner-loop. This is quite slow on many processors, especially ones like ARM that lack a hardware divide. Even on fairly recent x86_64 like haswell an integer division can take something like 100 cycles-- making it comparable to the runtime of siphash. This change avoids the division by using bitmasking instead. This was especially easy since the count was only increased by doubling. This change also restarts the timing when the execution time was very low this avoids mintimes of zero in cases where one execution ends up below the timer resolution. It also reduces the impact of the overhead on the final result. The formatting of the prints is changed to not use scientific notation make it more machine readable (in particular, gnuplot croaks on the non-fixedpoint, and it doesn't sort correctly). This also hoists out all the floating point divisions out of the semi-hot path because it was easy to do so. It might be prudent to break out the critical test into a macro just to guarantee that it gets inlined. It might also make sense to just save out the intermediate counts and times and get the floating point completely out of the timing loop (because e.g. on hardware without a fast hardware FPU like some ARM it will still be slow enough to distort the results). I haven't done either of these in this commit.
2016-05-30Merge #8107: bench: Added base58 encoding/decoding benchmarksWladimir J. van der Laan
5fac1f3 bench: Added base58 encoding/decoding benchmarks (Yuri Zhykin)
2016-05-28Benchmark SipHashPieter Wuille
2016-05-27bench: Added base58 encoding/decoding benchmarksYuri Zhykin
2016-05-11bench: Add crypto hash benchmarksWladimir J. van der Laan
Add benchmarks for the cryptographic hash algorithms: - RIPEMD160 - SHA1 - SHA256 - SHA512 Continues work on #7883.
2016-04-28Benchmark rolling bloom filterPieter Wuille
2015-10-27[Trivial] ensure minimal header conventionsPhilip Kaufmann
- ensure header namespaces and end comments are correct - add missing header end comments - ensure minimal formatting (add newlines etc.)
2015-10-06Ignore bench_bitcoin binary.Pavel Janík
2015-09-30Support very-fast-running benchmarksGavin Andresen
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.
2015-09-30Simple benchmarking frameworkGavin Andresen
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