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
Eric Fiselier
25eae60c4c
Attempt to fix MSVC build failures
2016-08-02 19:33:41 -06:00
Eric
5f5ca31ce0
Add RegisterBenchmark(name, func, args...)
for creating/registering benchmarks. ( #259 )
...
* Add RegisterBenchmark
* fix test inputs
* fix UB caused by unitialized value
* Add RegisterBenchmark
* fix test inputs
* fix UB caused by unitialized value
* Work around GCC 4.6/4.7/4.8 bug
2016-08-02 16:22:46 -07:00
Eric Fiselier
44128d87d2
Add --benchmark_out=<filename> and --benchmark_out_format=<format> options.
...
These options allow you to write the output of a benchmark to the specified
file and with the specified format. The goal of this change is to help support
tooling.
2016-08-02 15:12:43 -06:00
Vadym
f68e64c60a
add support for step in DenseRange() ( #260 )
2016-07-25 21:13:09 +02:00
Eric Fiselier
3b2d0abd2b
Use correct integer type for complexity. MSVC warns otherwise
2016-07-22 17:48:37 -06:00
Eric Fiselier
7e40ff9e35
Provide a better implementation of DoNotOptimize(...).
...
This implementation is less likely to ICE compilers, and is more correct.
It also acts as a memory barrier which will help prevent writes to global memory
from being optimized away.
2016-07-11 14:58:50 -06:00
Dominic Hamon
51c23a9115
Merge branch 'added_lambdas' of git://github.com/ismaelJimenez/benchmark into ismaelJimenez-added_lambdas
2016-06-02 14:33:14 -07:00
Ismael
2859ae9394
changed complexity_n to int and fix some whitespaces
2016-06-02 23:27:29 +02:00
Ismael
240ba4e64e
changed BigOFunc argument from size_t to int
2016-06-02 22:21:52 +02:00
Ismael
22cb9d9ce0
google formated
2016-06-02 22:01:31 +02:00
Ismael
109f528a40
removed functional library not needed
2016-06-02 19:48:53 +02:00
Ismael
11e3043554
checked format before pull request
2016-06-02 19:42:08 +02:00
Ismael
867f9145a0
added lambdas to complexity report
2016-06-01 23:08:01 +02:00
Billy O'Neal
3685cad68c
Added new noexcept macros for VS2013 ( #229 )
2016-05-31 14:52:26 -07:00
Eric Fiselier
02230445e0
Move UnitTime helpers to reporter.h
2016-05-27 16:53:30 -06:00
Eric
1b263fe6d9
Cleanup reporters ( #226 )
...
* Move ComputeStats call out of the reporters
* Cleanup adjusted time calculations in reporters
* Move ComputeBigO call out of reporters
* Remove ReportComplexity interface using ReportRuns instead
* Factor out reporting of basic context information
* Attempt to fix GCC 4.6 build errors
* Move ComputeStats to complexity.cc
2016-05-27 16:45:25 -06:00
Eric
238e558fdb
Allow benchmarks to take arbitrary arguments. ( #221 )
...
* Add lambda benchmarks
* Remove lambda capture since the lambda is not at a block scope
* Remove LambdaBenchmark helper since FunctionBenchmark can be used with non-capturing lambas
* Add lambda benchmarks
* Remove lambda capture since the lambda is not at a block scope
* Remove LambdaBenchmark helper since FunctionBenchmark can be used with non-capturing lambas
* Add more docs for BENCHMARK_CAPTURE.
* Fix use of misnamed parameter
* Guard BENCHMARK_CAPTURE tests against non-c++11 compilers
* Move tests out of basic_test.cc
2016-05-27 12:37:10 -07:00
Eric
5686bf1b38
Change reporters to use a specified output and error stream. Add tests for output. ( #219 )
...
* Add test for reporter output.
* setup err_stream tests
* Fix warnings in tests
* whitespace
* Fix build errors caused by super pedantic compilers
* Pass streams by pointer not non-const reference
2016-05-27 12:34:37 -07:00
Dominic Hamon
d6bc7e1581
Merge branch 'update_complexity' of git://github.com/ismaelJimenez/benchmark into ismaelJimenez-update_complexity
2016-05-26 14:01:28 -07:00
Ismael
ac3ec2ded3
moved complexity.h into src and BigO enum into benchmark_api
2016-05-26 21:16:40 +02:00
Ismael
37ab858e4b
initialized doubles to 0.0
2016-05-26 19:44:11 +02:00
Albert Pretorius
74e82e822f
Force DoNotOptimize operand to memory for both gcc and clang
2016-05-26 07:43:07 +01:00
Ismael
1715885611
fixed typos
2016-05-25 23:33:25 +02:00
Ismael
1ee11056c1
move include from .h into .cc
2016-05-25 23:13:19 +02:00
Ismael
2f61f8aee0
refactor leastsq into complexity
2016-05-25 22:57:52 +02:00
Ismael
e246699f25
added auto as default value for complexity
2016-05-25 21:18:56 +02:00
Dominic Hamon
9686f1769e
Merge branch 'skip_with_error' of git://github.com/efcs/benchmark into efcs-skip_with_error
2016-05-25 09:00:31 -07:00
Eric Fiselier
84bc4d703b
Add a per benchmark 'Repetitions' option.
2016-05-24 21:52:23 -06:00
Eric Fiselier
924b8cee7a
Reflow some wording. NFC
2016-05-24 15:21:41 -06:00
Eric Fiselier
bdeb38718e
merge
2016-05-24 15:01:07 -06:00
Dominic Hamon
2440b752fd
Formatting updates
2016-05-24 13:26:32 -07:00
Dominic Hamon
a86545874a
Merge branch 'ismaelJimenez-complexity'
2016-05-24 13:15:55 -07:00
Dominic Hamon
31cdabf6bb
Merge pull request #216 from efcs/diagnostic-checks
...
Add checks that <Resume|Pause>Timing functions are not called outside of the KeepRunning() loop. Fixes #204
2016-05-24 13:09:41 -07:00
Ismael
a24ef95e11
adapt complexity_n to leastsq inteface
2016-05-24 20:48:34 +02:00
Ismael
64d72ee7b2
changed complexity_n from int to size_t
2016-05-24 20:35:39 +02:00
Ismael
5e10e120db
fixed overshadow
2016-05-24 20:26:21 +02:00
Ismael
36a9ae197f
added SetComplexityN
2016-05-24 19:56:49 +02:00
Eric Fiselier
9341d705a1
Change --benchmark_list_tests to respect the benchmark filter.
...
This behavior mirrors how GTest handles these two flags.
2016-05-24 00:42:11 -06:00
Eric Fiselier
e0de8171c6
Change RunSpecifiedBenchmarks to return the number of benchmarks run. Fixes #145
2016-05-23 23:35:09 -06:00
Eric Fiselier
90c9ab1d8e
add doc
2016-05-23 20:35:09 -06:00
Eric Fiselier
43017f8b15
Add SkipWithError(...) function.
2016-05-23 19:24:56 -06:00
Eric Fiselier
481e06e65a
Address review comments
2016-05-23 15:27:43 -06:00
Eric Fiselier
69d1a52407
Add checks that <Resume|Pause>Timing functions are not called outside of the benchmark. Fixes #204
2016-05-23 15:05:55 -06:00
Ismael
855786acf5
added end of file carriage return
2016-05-23 22:49:16 +02:00
Ismael
0c23d2852f
extracted BigO and GetBigO in own file
2016-05-23 22:31:40 +02:00
Ismael
ac05c04533
refactor MinimalLEastSq
2016-05-23 20:12:54 +02:00
Ismael
5f9823bd92
fixed non-const reference arguments
2016-05-23 18:51:29 +02:00
Ismael
8afbf0ed38
reworked comment for complexity report
2016-05-21 16:45:45 +02:00
Ismael
290bd60289
Refactor for pull request
2016-05-21 11:51:42 +02:00
Ismael
2e5c397b48
implemented complexity reporting
2016-05-21 08:55:43 +02:00
Ismael
872ff01a49
addaptation of minimal_leastsq library
2016-05-20 16:49:39 +02:00
Ismael
b73dc22944
implemented Complexity for O(1)
2016-05-18 21:25:00 +02:00
Ismael
27f0baa190
Added test file and Complexity() interface
2016-05-18 19:59:34 +02:00
Ismael
c60eefdbb7
added option to change range multiplier
2016-05-14 15:56:34 +02:00
Jussi Knuuttila
e253a28402
Manual timing support.
2016-05-05 23:24:13 +03:00
Kai Wolf
f352c30f1c
Merge branch 'master' into feature/add-ms-time-report
2016-04-29 21:42:21 +02:00
Dmitry Vyukov
838719dc02
Update benchmark_api.h
2016-04-18 14:24:13 +02:00
Kai Wolf
0b4111c3b3
Refactor GetTimeUnitAndMultiplier and add example
2016-03-28 21:32:11 +02:00
Kai Wolf
7c69b36078
Add an additional parameter for time units
2016-03-26 01:04:17 +01:00
Kai Wolf
cded70a166
Add optional ms time unit for console reporter
...
Some benchmarks may run a few milliseconds which makes it kind of hard to visually compare, since the currently only available nanoseconds numbers can get very large in this case. Therefore this commit adds an optional command line flag --benchmark_time_unit which lets the user choose between ns and ms time units for displaying the mean execution time.
2016-03-24 22:18:55 +01:00
Mohamed Amin JABRI
53aca9bc71
Pass const State to Fixture::TearDown. Fix memory leak in fixture_test
2016-02-24 17:36:34 +09:00
Dominic Hamon
31e71be77c
Merge pull request #181 from google/map_test
...
Pass const state to Fixture::SetUp. Add map_test.
2016-02-16 02:08:29 -08:00
Jakob Buchgraber
007efee751
Add number of threads to State.
...
Having access to the thread count from within a benchmark is useful,
for when one wants to distribute a workload dynamically among the
benchmarks running in parallel e.g when using ThreadRange() or
ThreadPerCpu().
2016-02-15 21:39:15 +01:00
Dominic Hamon
53068f974c
Pass const state to Fixture::SetUp. Add map_test.
2016-02-15 03:04:19 -08:00
Eli Bendersky
c7ab1b987b
Update README to mention UseRealTime for wallclock time measurements.
...
Also adding a use case in the API header.
Fixes #170
2015-12-30 06:01:19 -08:00
Greg Miller
2463339d0b
Updates Initialize() to work with an argv as 'char**'
2015-09-30 16:14:50 -04:00
Dominic Hamon
7583ed9363
Merge pull request #137 from jll63/jleroy/vs2013-compatibility
...
Jleroy/vs2013 compatibility
2015-09-30 10:23:57 -07:00
Eli Bendersky
1dd40c99c0
Custom arguments function usage with Apply - fix doc and add test.
2015-09-23 12:47:54 -07:00
Eli Bendersky
f338ce7965
Fix doc sample typos in header and README
...
* iterations() is a method
* int64_t fix in a couple of places
2015-09-17 20:14:10 -07:00
Jean-Louis Leroy
2cf277b6f6
Iterations declared as size_t but printf'ed as a long long. Make it a long long.
2015-09-03 15:11:10 -04:00
Jean-Louis Leroy
d49516bc99
Make it compile with Visual Studio 2013.
2015-09-03 15:11:09 -04:00
Dominic Hamon
47c304536e
Fix #133 . Comment now contains compilable code.
2015-08-07 11:21:47 -07:00
Dominic Hamon
fdd99b12a8
trailing whitespace
2015-06-18 10:34:03 -07:00
Eric Fiselier
9c25a67c1a
address more review comments
2015-04-06 19:04:12 -04:00
Eric Fiselier
9ed538f511
address review comments
2015-04-06 17:56:05 -04:00
Eric Fiselier
12f4405870
add ability to use benchmark filters
2015-04-06 17:00:06 -04:00
David Reynolds
30ae37b923
Fix typos: rangeY -> range_y()
2015-04-02 18:34:52 -07:00
Eric Fiselier
805145847b
add workaround to DoNotOptimize(...) for clang inline assembly bug.
2015-03-30 22:14:08 -04:00
Dominic Hamon
71c41cde57
Introduce CSV reporter
2015-03-27 14:07:23 -07:00
Eric Fiselier
9ed1082c33
Merge branch 'master' into new-benchmark-interface
2015-03-27 16:36:40 -04:00
Eric Fiselier
e428b9eec3
Add 'benchmark::DoNotOptimize(...)' to help users prevent optimizations
2015-03-27 16:35:46 -04:00
Eric Fiselier
4f9ce87e8c
Merge branch 'master' into new-benchmark-interface
2015-03-27 16:26:36 -04:00
Eric Fiselier
4bf6ceb50d
Change the available benchmark options
2015-03-26 23:37:26 -04:00
Eric Fiselier
75712367c1
update names
2015-03-18 22:49:09 -04:00
Eric Fiselier
e96f068a1d
rename BENCHMARK_PRIVATE_NAME to BENCHMARK_PRIVATE_CONCAT
2015-03-18 19:19:17 -04:00
Eric Fiselier
3bf0b251a3
remove whitespace
2015-03-18 18:35:36 -04:00
Eric Fiselier
035a0ba2b3
fix macro names and use __COUNTER__
2015-03-18 18:34:30 -04:00
Eric Fiselier
38066e8bdc
Add variadic macro for BENCHMARK_TEMPLATE in c++11 and beyond.
2015-03-18 14:50:50 -04:00
Eric Fiselier
01bba479ac
Remove use of reserved names in benchmark macros
2015-03-18 14:50:16 -04:00
Eric Fiselier
a6a90ec6b8
Revert "Add BENCHMARK_TEMPLATE1 macro"
...
I didn't mean to commit this to master.
This reverts commit b7d03ac4f5
.
2015-03-18 14:43:08 -04:00
Eric Fiselier
b7d03ac4f5
Add BENCHMARK_TEMPLATE1 macro
2015-03-18 14:42:35 -04:00
Eric Fiselier
6429348e0d
address review comments and fix array type declaration
2015-03-18 00:23:43 -04:00
Eric Fiselier
f65da9d581
add json reporter
2015-03-17 18:18:06 -04:00
Eric Fiselier
20f1c0e2a8
Apply reporter interface changes. Make report methods non-const and add a Finalize method.
2015-03-17 16:16:36 -04:00
Eric Fiselier
e45252e6f5
move ConsoleReporter out of internal namespace
2015-03-17 14:15:16 -04:00
Eric Fiselier
8e72846da4
rename minimal_benchmark.h and fix recursive include in benchmark_api.h
2015-03-17 14:01:04 -04:00
Eric Fiselier
df904a1980
add include to minimal_benchmark.h
2015-03-17 13:58:25 -04:00
Eric Fiselier
35f9de71ee
move to using C headers in minimal_benchmark.h to prevent getting any C++ STL headers
2015-03-17 13:51:04 -04:00
Eric Fiselier
4242f2f1d7
move reporter internals in both headers and source
2015-03-17 13:46:16 -04:00