Commit Graph

11 Commits

Author SHA1 Message Date
Marcin Kolny
dfe0260754 Support multiple ranges in the benchmark (#257)
* Support multiple ranges in the benchmark

google-benchmark library allows to provide up to two ranges to the
benchmark method (range_x and range_y). However, in many cases it's not
sufficient. The patch introduces multi-range features, so user can easily
define multiple ranges by passing a vector of integers, and access values
through the method range(i).

* Remove redundant API

Functions State::range_x() and State::range_y() have been removed. They should
be replaced by State::range(0) and State::range(1).
Functions Benchmark::ArgPair() and Benchmark::RangePair() have been removed.
They should be replaced by Benchmark::Args() and Benchmark::Ranges().
2016-08-04 12:30:14 -07:00
izaid
14c4ce5ebf Removed unneeded #include <cstddef> 2015-10-06 15:10:15 +01:00
Eric Fiselier
9d47552020 merge new changes in basic_test.cc 2015-03-27 16:37:53 -04:00
Eric Fiselier
e428b9eec3 Add 'benchmark::DoNotOptimize(...)' to help users prevent optimizations 2015-03-27 16:35:46 -04:00
Eric Fiselier
725f1f066d add walltime benchmark and fix unused variable. 2015-03-26 14:56:52 -04:00
Eric Fiselier
be993acbb3 remove unneeded test repetitions 2015-03-26 14:33:48 -04:00
Eric Fiselier
d0df7ef2de cleanup whitespace and includes 2015-03-26 14:30:16 -04:00
Eric Fiselier
a3308c6d86 Introduce use of std::chrono and remove Walltime printing 2015-03-26 14:26:07 -04:00
Eric Fiselier
d71660227b fix minimal_benchmark.h include 2015-03-17 14:02:02 -04:00
Eric Fiselier
ef79d0af9f move basic_test over to minimal benchmark 2015-03-17 13:48:33 -04:00
Eric Fiselier
7a767012f1 Adopt new benchmark timing internals.
This patch adopts a new internal structure for how timings are performed.
Currently every iteration of a benchmark checks to see if it has been running
for an appropriate amount of time. Checking the clock introduces noise into
the timings and this can cause inconsistent output from each benchmark.

Now every iteration of a benchmark only checks an iteration count to see if it
should stop running. The iteration count is determined before hand by testing
the benchmark on a series of increasing iteration counts until a suitable count
is found. This increases the amount of time it takes to run the actual benchmarks
but it also greatly increases the accuracy of the results.

This patch introduces some breaking changes. The notable breaking changes are:
1. Benchmarks run on multiple threads no generate a report per thread. Instead
   only a single report is generated.
2. ::benchmark::UseRealTime() was removed and replaced with State::UseRealTime().
2015-03-12 18:03:33 -04:00