Commit graph

464 commits

Author SHA1 Message Date
Joao Paulo Magalhaes 409f35da50 User counters: fix misplaced newline in console reporter header. 2017-04-27 19:22:36 +01:00
vladoovt 1295ce8f23 Fixes #378 coercion to double was causing counter to forget its flags, changed it so that its value is updated directly 2017-04-27 09:56:43 -06:00
Joao Paulo Magalhaes 2d1a34626f Fixes #378 (hopefully). Unit tests for counters to follow.
The problem was that the call to Finish() the user counters was
lost in a big merge. If I had already written the tests for the
user counters, this would probably have been catched earlier.
2017-04-27 13:16:49 +01:00
Dmitry Trifonov 7a74b74856 fix for android NDK r10e (#375) 2017-04-20 20:07:52 -06:00
Dmitry Trifonov 09b93ccc6a fix android compilation (#372)
* fix android compilation

* checking __GLIBCXX__ and __GLIBCPP__ macro in addition to __ANDROID__

* using vsnprintf instead of std::vsnprintf to compile on Android

* removed __GLIBCPP__ check on Android

* StringPrintF instead of std::to_string for Android
2017-04-18 09:48:07 -06:00
Eric Fiselier 46afd8e693 Don't limit benchmarks with manual timers to 5x the elapsed real time.
When using CPU time to determine the correct number of iterations the
library additionally checks if the benchmark has consumed 5x the minimum
required time according to the wall clock. This prevents benchmarks
with low CPU usage from running for much longer than actually intended.

However when a benchmark uses a manual timer this heuristic isn't helpful
and likely isn't correct since we don't know what the manual timer actually
measures.

This patch removes the above restriction when a benchmark specifies a manual
timer.
2017-04-18 00:13:18 -06:00
Eric 74b24058ad Add Benchmark::Iterations for explicit iteration count control - Fixes #370 (#373)
* Add Benchmark::Iterations for explicitly specifying the number of iterations to use.

* Document that benchmark::Iterations should not be used to limit benchmark runtimes
2017-04-17 21:29:28 -07:00
Daniel Varga 312d9d0ac5 Fix cmake file not to use CMAKE_SOURCE_DIR (#367)
Using CMAKE_SOURCE_DIR benchmark cannot be built as part of a project.
This change allows to add benchmark using add_subdirectory to a bigger
project.
2017-04-10 08:43:05 -07:00
jpmag 9a5072d1bf Fixes #357: broken RMS values when time unit is set. (#362) 2017-04-04 12:31:28 -07:00
Dominic Hamon 858581ea76 Remove unnecessary benchmark subfolder 2017-04-04 08:39:02 -07:00
Dominic Hamon 66283598e6 Merge branch '1.1' of git://github.com/piribes/benchmark into piribes-1.1 2017-04-04 08:35:51 -07:00
Giuseppe Roberti 128fe25025 Fix ${include_install_dir} 2017-04-04 02:13:20 +02:00
Giuseppe Roberti 824bbb818e Add CMake Package Config files during install
- Remove target_include_directories of ${PROJECT_SOURCE_DIR}/include to
  fix error: Target "benchmark" INTERFACE_INCLUDE_DIRECTORIES property
  contains path which is prefixed in the source directory.
2017-04-03 01:54:24 +02:00
MVafin ec15860da5 Fix CPU frequency parsing on Linux (#355) (#356)
* Fix reading CPU info from file

Macro CHECK do nothing for release mode, meaning it doesn't invoke the
arguments

* Add myself to AUTHORS and CONTRIBUTORS
2017-03-28 00:35:17 -06:00
Eric 94c512c043 Replace int64_t usages with 'int' instead. (#359)
Previously the constants used for converting between
different units of time were declared using int64_t. However
we should only use explicitly sized integer types when they
are required, and should use 'int' everwhere else, and there is
no good reason to use int64_t here.

For that reason this patch changes the type of the constants.
This should help address issue #354 as well.
2017-03-27 18:32:12 -06:00
Yasushi Saito f5ff6d0e0d Include cstdlib for timespec. Clang modules demands that. (#353) 2017-03-13 20:30:19 -06:00
Joao Paulo Magalhaes d84d911d37 Tabular counters: fix missing cast on MSVC. 2017-03-02 12:19:56 +00:00
Joao Paulo Magalhaes c846eedfeb Fix use of C-style cast. 2017-03-02 12:10:43 +00:00
Joao Paulo Magalhaes cbb2eb83d1 Tabular counters: fix dangling reference to color_output_. 2017-03-02 12:10:06 +00:00
Joao Paulo Magalhaes 0de985ae9d Add command line option --benchmark_counters_tabular 2017-03-02 02:55:36 +00:00
jpmag 9e34655602 Rename BenchmarkCounters to UserCounters (#346)
The name UserCounters seems more accurate than the pleonastic BenchmarkCounters.
2017-03-01 17:50:19 -07:00
jpmag a9a66c85bb Add user-defined counters. (#262)
* Added user counters, and move use of bytes_processed and items_processed to user counter logic.

Each counter is a string-value pair. The counters were
made available through the State class. Two helper virtual
methods were added to the Fixture class to allow convenient
initialization and termination of the counters: InitState()
and TerminateState(). The reporting of the counters is buggy
and is still a work in progress, to be completed in the next commits.

* fix bad removal of BenchmarkCounters code during the merge

* add myself to AUTHORS/CONTRIBUTORS

* fix printing to std::cout in csv_reporter

* bytes_per_second and items_per_second are now in the UserCounters class

* add user counters to json reporter

* moving bytes_per_second and items_per_second to their old state

* console reporter dealing ok with user counters.

* update unit tests for user counters

* CSVReporter now prints user counters too.

* cleanup user counters

* reverted changes to cmake files which should have gone into later commits

* fixture_test: fix gcc 4.6 compilation

* remove ctor with default argument

see https://github.com/google/benchmark/pull/262#discussion_r72298055

* use (auto-defined) BENCHMARK_HAS_CXX11 instead of BENCHMARK_INITLIST.

https://github.com/google/benchmark/pull/262#discussion_r72298310

* leanify counters API

Discussions:
API complexity: https://github.com/google/benchmark/pull/262#discussion_r72298731
remove std::string dependency (WIP): https://github.com/google/benchmark/pull/262#discussion_r72298142
spacing & alignment: https://github.com/google/benchmark/pull/262#discussion_r72298422

* remove std::string dependency on public API - changed counter name storage to char*

* Counter ctor: use overloads instead of default arguments

discussion:
https://github.com/google/benchmark/pull/262#discussion_r72298055

* Use raw pointers to remove dependency on std::vector from public API .

For more info, see discussion at https://github.com/google/benchmark/pull/262#discussion_r72319678 .

* Move counter implementation from benchmark.cc to counter.cc.

    See discussion: https://github.com/google/benchmark/pull/262#discussion_r72298980 .

* Remove unused (commented-out) code.

* Moved thread counters to ThreadStats.

* Counters: fixed copy and move constructors.

* Counter: use an inplace buffer for small names.

* benchmark_test: move counters test out of CXX11 preprocessor conditional.

* Counter: fix VS2013 compilation error in char[] initialization.

* Fix typo.

* Expose counters from State.

See discussion: https://github.com/google/benchmark/pull/262#issuecomment-237156951

* Changed counters interface to map-like.

* Fix printing of user counters in ConsoleReporter.

* Applied clang-format to counter.cc and console_reporter.cc.

Command was `clang-format -style=Google -i counter.cc console_reporter.cc`
I also applied to all other files, but the changes were very
far-reaching so I rolled those back.

* Rename Counter::Flags_e to Counter::Flags

* Fix use of reserved names in Counter and BenchmarkCounters.

* Counter: Fix move ctor bug + change order of members.

* Fixture: remove tentative methods InitState() and TerminateState().

* Update fixture_test to the new Fixture interface.

* BenchmarkCounters: fixed a bug in the move ctor. Remove call to CHECK_LT().

CHECK_LT() was making the size_t lookup take ~double the time of a string lookup!

* BenchmarkCounters: add option to not print zero counters (defaults to false).

* Add test to compare counter storage and access with std::map.

* README: clarify cost of counter access modes.

* move counter access test to an own test.

* BenchmarkCounters: add move Insert()

* Counters access test: add accelerated lookup by name.

* Fix old range syntax.

* Fix missing include of cstdio

* Fix Visual Studio warning

* VS2013 and lower: fix use of snprintf()

* VS2013: fix use of char[] as a member of std::pair<>.

* change counter storage to std::map

* Remove skipZeroCounters logic

* Fix VS compilation error.

* Implemented request changes to PR #262.

* PR #262: More requested changes.

* README: cleanup counter text.

* PR #262: remove clang-format changes for preexisting code

* Complexity+Counters: fix counter flags which were being ignored.

* Document all Counter::Flag members

* fixed loss of counter values

* ConsoleReporter: remove tabular printing of user counters.

* ConsoleReporter: header printing should not be contingent on user counter names.

* Minor white space and alignment fixes.

* cxx03_test + counters: reuse the BM_empty() function.

* user counters: add note to README on how counters are gathered across threads
2017-03-01 17:23:42 -07:00
Marat Dukhan 070c0ca0a9 Support for Web platforms (#340)
* Implement cycleclock::Now for PNaCl

* Make cycleclock::Now compatible with NaCl/ARM

* Support Emscripten (Asm.js, WebAssembly)

* Rearrange #ifs from to handle specific cases first

* DoNotOptimize without inline asm for Emscripten & PNaCl
2017-02-11 03:31:40 -07:00
guray fef203bd02 Fix typename for powerpc (#337) 2017-01-30 12:50:21 -08:00
Matt Sieren 246ee86428 Disable iOS CPU Frequency readout (#335)
* Add macro definition for iOS

Add an additional macro definition for iOS.
iOS is defined as a Mac OSX invariant in the TargetConditionals include,
thus we treat it as a subset of OSX within the defines.

* Skip error for hw.cpufrequency on iOS

hw.cpufrequency is not available on iOS devices. As there is no way to reliably
retrieve the CPU frequency on iOS we are printing out a warning
that we were unable to detect the CPU frequency and set it to 0.

This only disables cpu frequency readouts on actual physical iOS devices.
Running this code on the simulator still gives the cpu architecture of
the host computer as the simulator passes down the sysctl calls to OSX.
2017-01-24 11:31:14 -08:00
Niklas Rosenstein 817bfee273 Report unrecognized arguments from BENCHMARK_MAIN() macro (#332)
* BENCHMARK_MAIN() now reports unrecognised command-line flags (see google/benchmark#320)

* add benchmark::ReportUnrecognizedArguments()

Update BENCHMARK_MAIN() to use ReportUnrecognizedArguments() instead of
having the reporting code directly in the macro.

See issue google/benchmark#320 for reference

* let's stick to american english -- fix type in ReportUnrecognizedArguments()

* make ReportUnrecognizedArguments() print to stderr

* make ReportUnrecognizedArguments() return true if any arguments have been reported (i.e. argc > 1)
2017-01-17 19:28:20 -08:00
jpmag b4fdf6e9df HumanReadableNumber(): Simplify output for simple numbers. Examples: (#291)
* HumanReadableNumber(): Simplify output for simple numbers. Examples:

HumanReadableNumber(    0.0)=      0    ---->         0
HumanReadableNumber(    0.5)=   512m    ---->       0.5
HumanReadableNumber(    0.9)= 921.6m    ---->       0.9
HumanReadableNumber(    1.0)=  1024m    ---->         1
HumanReadableNumber(   1.05)=1075.2m    ---->      1.05
HumanReadableNumber(    1.1)=    1.1    ---->       1.1
HumanReadableNumber(    1.2)=    1.2    ---->       1.2
HumanReadableNumber( 0.0e-1)=      0    ---->         0
HumanReadableNumber( 0.5e-1)=  51.2m    ---->      0.05
HumanReadableNumber( 0.9e-1)= 92.16m    ---->      0.09
HumanReadableNumber( 1.0e-1)= 102.4m    ---->       0.1
HumanReadableNumber(1.05e-1)=107.52m    ---->     0.105
HumanReadableNumber( 1.1e-1)=112.64m    ---->      0.11
HumanReadableNumber( 1.2e-1)=122.88m    ---->      0.12
HumanReadableNumber( 0.0e-3)=      0    ---->         0
HumanReadableNumber( 0.5e-3)=524.288u   ---->   524.288u
HumanReadableNumber( 0.9e-3)=943.718u   ---->   943.718u
HumanReadableNumber( 1.0e-3)=1048.58u   ---->   1048.58u
HumanReadableNumber(1.05e-3)=  1101u    ---->   0.00105
HumanReadableNumber( 1.1e-3)=1.1264m    ---->    0.0011
HumanReadableNumber( 1.2e-3)=1.2288m    ---->    0.0012

* HumanReadableNumber(): change simple printing threshold to 0.01.

* ToExponentAndMantissa(): refactor branch sequence.
2017-01-13 14:19:42 -08:00
Alt 34010beecb Fix librt linking on systems which has it (#331) 2017-01-13 08:41:29 -08:00
BRevzin 4bf28e611b Issue 327 (#328)
Arguments shouldn't be AppendHumanReadable()-ed, they should just be shown as-is.
2016-12-20 11:37:17 -08:00
Niklas Rosenstein 56336e70f1 fix argv accessed out of bounds in ParseCommandLineFlags() (#321) 2016-12-06 08:38:03 -08:00
Eric efd4e992a6 Add support for building w/o exceptions (#317) 2016-12-05 09:24:09 -08:00
Dominic Hamon 4f8bfeae47 Report error when no benchmarks match regex. (#308)
Fixes #306
2016-10-28 14:22:22 -07:00
Marek Kurdej 3f23832a09 Allow calling Args and ArgNames in any order. 2016-10-26 09:36:39 +02:00
Marek Kurdej cfee1a54e4 Check argument count in ArgName and ArgNames. 2016-10-26 09:29:28 +02:00
Marek Kurdej c1c01b2cd3 Handle the case when the argument name is an empty string. 2016-10-25 09:45:35 +02:00
Marek Kurdej 17e1c405dd Add ArgName() and ArgNames() methods to name arguments/ranges. 2016-10-24 09:57:40 +02:00
Marek Kurdej 5aa3855627 Fix displayed time unit in mean and standard deviation. 2016-10-21 14:33:23 +02:00
Eric Fiselier 57a22c69b3 Fix typo in timer.cc that caused negative CPU times on OS X. Fixes #293 2016-10-08 02:12:40 -06:00
Eric Fiselier 721c9224b9 Fix getting the CPU frequency on OS X 2016-10-08 01:38:09 -06:00
Eric Fiselier 03c4485d84 Fix #295. Remove use of BSD extensions for comparing strings 2016-10-07 22:54:06 -06:00
Eric Fiselier 36a251ab3e Fix #300. Emit RMS as a float not a percentage in JSON 2016-10-07 22:26:01 -06:00
Dominic Hamon 332f677b8b Apply clang-format to all headers and source (#303) 2016-10-07 11:35:03 -07:00
Eric Fiselier 2aca242bf6 Fix various uninitialized members 2016-09-28 18:21:36 -06:00
Alt 6cadcf7f14 Fix working on mac clock_gettime (#292)
* fix working on mac clock_gettime

* Comment fixme
2016-09-26 15:48:25 -07:00
Nicholas Hutchinson 917b86e615 Auto-detect whether Benchmark should produce colorized output (#126)
* Auto-detect whether to produce colorized output

Rename --color_print to --benchmark_color for consistency with the other
flags (and Google Test). Old flag name is kept around for compatibility.

The --benchmark_color/--color_print flag takes a third option, "auto",
which is the new default. In this mode, we attempt to auto-detect
whether to produce colorized output. (The logic for deciding whether to
use colorized output was lifted from GTest:
<https://github.com/google/googletest/blob/master/googletest/src/gtest.cc#L2925>.)

* Update CONTRIBUTORS, AUTHORS
2016-09-15 15:10:35 -06:00
Nicholas Hutchinson b826143ac2 Flush reporters' output streams after writing a benchmark run (#288)
If a reporter's output stream isn't line-buffered (e.g. it's not writing
to a terminal) then it can be some time before a write to it becomes
visible.

This is problematic if, say, you're wanting to use tail -f to view the
file written to via --benchmark_out. Or if the application crashes,
leaving you with no results.

Addressed by flushing the reporters' output streams whenever we invoke
methods that may write to them.
2016-09-11 15:36:14 -06:00
Eric c6f3f0eb9c Cleanup RunBenchmark code. (#289)
* Cleanup the code for generating and running benchmarks

* Rework calculation of real/manual time

* Add back TSAN builder
2016-09-06 02:28:35 -06:00
Eric d038472c18 Refactor benchmark.cc into benchmark_register.cc and benchmark.cc (#287)
* Refactor benchmark.cc into benchmark_register.cc and benchmark_run.cc

The benchmark.cc file is getting really big and it contains a bunch of
unrelated components. This patch separates the files into two separate
parts. The "runtime" parts and the "registration" parts.

This patch also removes the PIMPL used by Benchmark. Previously we couldn't
have STL types in the interface but now we can. Therefore there is no reason
to keep BenchmarkImp.

* add missing include

* rework windows timers again

* Guard timespec on older Windows versions

* Remove old thread safety annotation workarounds
2016-09-05 15:48:40 -06:00
Ronny 72be9523bb Add Benchmark::ThreadRange() version with increment instead of multiply (#283)
* add additive thread range

* add test
2016-09-03 13:56:46 -06:00
Eric Fiselier f261c68074 Try and add MSVC NORETURN attribute again 2016-09-03 00:13:20 -06:00
Eric Fiselier 5224b63c35 Fix BENCHMARK_NORETURN on MSVC 2016-09-02 23:54:58 -06:00
Eric cba945e37d Make PauseTiming() and ResumeTiming() per thread. (#286)
* Change to using per-thread timers

* fix bad assertions

* fix copy paste error on windows

* Fix thread safety annotations

* Make null-log thread safe

* remove remaining globals

* use chrono for walltime since it is thread safe

* consolidate timer functions

* Add missing ctime include

* Rename to be consistent with Google style

* Format patch using clang-format

* cleanup -Wthread-safety configuration

* Don't trust _POSIX_FEATURE macros because OS X lies.

* Fix OS X thread timings

* attempt to fix mingw build

* Attempt to make mingw work again

* Revert old mingw workaround

* improve diagnostics

* Drastically improve OS X measurements

* Use average real time instead of max
2016-09-02 21:34:34 -06:00
biojppm 83561f0580 CMake: add headers to the list of source files. (#284)
cmake does not require this, but IDEs such as VisualStudio or QtCreator
need this to add the headers to the generated project.
2016-08-31 15:28:43 -07:00
Eric df7bd92afd Add warning for large benchmark families (#279)
* Add warning for large benchmark families

* reflow comment
2016-08-29 12:43:55 -06:00
Eric 6e25917001 Add -DBENCHMARK_USE_LIBCXX:BOOL=<value> option. (#280)
* Add BENCHMARK_USE_LIBCXX option.

* Add comments

* re-add zero null pointer warning
2016-08-29 12:43:30 -06:00
Eric Fiselier 2e0796e148 Cleanup and optimize Range generation. 2016-08-28 23:15:55 -06:00
Eric Fiselier db1af86d16 Fix out-of-bounds std::vector access.
In the `Ranges(...)` generation code a "control" vector which stores
the current index for each range passed to `Ranges`. Previously this vector
was incorrectly initialized to the size of the subranges not the number
of subranges.

Additionally this patch suppresses unused warnings generated by
`stream_init_anchor`.
2016-08-28 23:07:38 -06:00
Eric Fiselier cbcd7b656e Fix std::cout/std::cerr static initialization order fiasco.
The benchmark library internals write to std::cout/std::cerr during program
startup. This can cause segfaults when the user doesn't include <iostream> in
the benchmark (which init's the streams). This patch fixes this by emitting
a dynamic initializer in every TU which initializes the streams.
2016-08-28 22:48:48 -06:00
Eric a11fb69c89 Add --benchmark_report_aggregates_only={true|false} flag for better summary output. (#267) 2016-08-10 18:20:54 -06:00
Eric Fiselier 95dee3c699 Work around bogus GCC warning 2016-08-08 02:22:49 -06:00
Eric Fiselier c04f703ab4 Fix signed integer overflow UB in complexity computations.
Previously the FittingCurve functions for n^2 and n^3 did the calculation
using int types. This can overflow and cause UB. This patch changes the
calculations to use std::pow to prevent this.

Also re-enable VC 2013 appveyor bot since I *hope* this is what was causing
the failures.
2016-08-07 17:33:18 -06:00
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 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 a2ca94dd10 Fix missing SYSTEM_INFO initializers 2016-07-23 16:22:13 -06:00
Sven ebd37b191c set cpuinfo_num_cpus on Windows (#254) 2016-07-13 13:00:32 -07:00
Elliott Hughes b805b7c6e0 Add missing volatiles to 32-bit ARM cycleclock assembler. (#253)
Without these, clang reorders these instructions as if they were
regular loads/stores which causes SIGILL from the kernel because
it performs all the loads before it starts testing the values.
2016-07-12 12:40:09 -07:00
Ismael 885ca41cf8 added check for SetComplexityN (#248) 2016-06-27 11:26:23 -07:00
Ismael a0783fd7f6 fix 244 (#247) 2016-06-27 11:25:43 -07:00
Ismael 3fdd76bd14 fix issue 235 (#236) 2016-06-03 09:33:17 -07:00
Dominic Hamon e498143168 fix warning on loss of integer precision 2016-06-02 14:37:14 -07: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 1a633969b3 changed BigO logic order 2016-06-02 22:23:39 +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 84cd50b85e Add workaround for VS2013 const-incorrect atomic (#230) 2016-05-31 16:54:02 -07:00
Billy O'Neal 3685cad68c Added new noexcept macros for VS2013 (#229) 2016-05-31 14:52:26 -07:00
Eric Fiselier 519e8d0e56 Fix missing declaration of FLAGS_color_print 2016-05-30 16:52:24 -06:00
Eric Fiselier 7188824c33 Fix windows build in console_reporter.cc. Fixes #228 2016-05-30 15:33:52 -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 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 c1c7d33279 added benchmar_apit to complexity.cc 2016-05-26 22:39:17 +02:00
Ismael 805e8baee9 small refactor 2016-05-26 21:26:43 +02:00
Ismael ac3ec2ded3 moved complexity.h into src and BigO enum into benchmark_api 2016-05-26 21:16:40 +02:00
Ismael d82f0c3131 added includes 2016-05-26 20:57:27 +02:00
Ismael 37ab858e4b initialized doubles to 0.0 2016-05-26 19:44:11 +02:00
Ismael 1715885611 fixed typos 2016-05-25 23:33:25 +02:00
Ismael 340fe557e2 indent 2016-05-25 23:22:53 +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 087f0d3f1b upgraded leastsq 2016-05-25 22:26:57 +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 1003a70e5f Fix csv_reporter when reporting errors 2016-05-24 19:45:18 -06:00
Eric Fiselier 6f84ffcd8b fix another bad merge 2016-05-24 18:25:44 -06:00
Eric Fiselier ee8e37c67d Fix bad merge which caused the benchmark name to be printed twice 2016-05-24 16:19:04 -06:00
Eric Fiselier 6a45324e1d Address review comments. 2016-05-24 16:12:30 -06:00
Eric Fiselier 525858e687 Fix error-handling in reporters 2016-05-24 15:44:58 -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 f126852c8f simplify format string for complexity output 2016-05-24 13:15:16 -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 5e10e120db fixed overshadow 2016-05-24 20:26:21 +02:00
Ismael e5cf020d97 fixed warning 2016-05-24 20:06:54 +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 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 0c23d2852f extracted BigO and GetBigO in own file 2016-05-23 22:31:40 +02:00
Ismael 266b3bd635 changed color and remove iterations 2016-05-23 22:09:55 +02:00
Ismael 43ef17441c refactor names 2016-05-23 20:50:35 +02:00
Ismael d577987fd7 changed indentation 2016-05-23 20:40:41 +02:00
Ismael ea69a84790 fix 2016-05-23 20:34:54 +02:00
Ismael fed9b6f211 refactor least square .h 2016-05-23 20:34:01 +02:00
Ismael 266addc3f5 fixed last_benchmark_instance 2016-05-23 20:21:34 +02:00
Ismael ac05c04533 refactor MinimalLEastSq 2016-05-23 20:12:54 +02:00
Ismael 5e52d2d6c0 refactor fitting curve 2016-05-23 19:19:29 +02:00
Ismael 5f9823bd92 fixed non-const reference arguments 2016-05-23 18:51:29 +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 d2103de3d3 Modified check for range multiplier 2016-05-16 18:17:11 +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
Jussi Knuuttila dce2ebb403 Fixed a warning caused by an implicit narrowing cast. 2016-05-05 20:34:44 +03:00
Dominic Hamon 02f409a71f Only output optional fields if they're set 2016-05-02 12:04:16 -07:00
Kai Wolf 1203b3cbe4 Fix missing <tuple> header in csv/json_reporter 2016-03-30 09:14:04 +02:00
Kai Wolf e6d62fd135 Add GetTimeAndMultiplier to json and csv reporter as well 2016-03-29 20:35:38 +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
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 af489cd4a3 Merge pull request #176 from enh/cycle-timer-aarch64
Add aarch64 support to src/cycleclock.h.
2016-02-13 13:05:16 -08:00
Elliott Hughes 930d3af052 Fix ARM /proc/cpuinfo parsing.
Also fix related warning message typos.
2016-02-10 16:20:05 -08:00
Elliott Hughes d9630aee88 Add aarch64 support to src/cycleclock.h.
From google3's base/cycleclock.
2016-02-10 15:48:27 -08:00
Eric Fiselier f662e8be5b Rename OS_MACOSX macro to new name BENCHMARK_OS_MACOSX. Fix #169 2015-12-14 15:02:30 -07:00
ryobg a863aead13 Fixes #159: Add inclusion of cstdio to files using stdout, vprintf, printf and etc. 2015-11-06 11:07:26 +02:00
guanqun 65cd2bac6c add static_cast to get rid of warnings for intel compiler on linux platform 2015-10-25 20:43:27 +08:00
Dominic Hamon 90e7cf000e Update macro names in comments. 2015-10-12 09:50:01 -07:00
Anton Danielsson 8c71c307ac Fixed OS macros changed in previous pull request. 2015-10-09 09:09:14 +02:00
Anton Danielsson a2f2a28b31 Changed date format to ISO 8601. 2015-10-09 09:05:19 +02:00
Anton Danielsson 032c190c4a Removed newline. 2015-10-09 09:00:42 +02:00
Anton Danielsson 7e9800e78a Added a comment why std::vsnprintf is not used. 2015-10-09 08:47:37 +02:00
Anton Danielsson c8f4690fd4 Sorted include of headers. 2015-10-09 08:47:36 +02:00
Anton Danielsson 0d35f5f68a Only include "sys/sysctl.h" if it is needed.
sys/sysctl.h is not available in the android-ndk.
2015-10-09 08:47:34 +02:00
Anton Danielsson c1e03a4b58 Changed "std::vsnprintf" to "vsnprintf" to be able to build with the android-ndk. 2015-10-09 08:47:34 +02:00
Anton Danielsson aecd746691 Added include of cstdlib needed for strtol, strtod and getenv. 2015-10-09 08:47:33 +02:00
Mayeul d'Avezac da80193de9 Fixes compilation issue on Macs
ba141ac0d9 renamed OS_MACOSX -> BENCHMARK_OS_MACOSX,
except for an include guard in src/cycleclock.h
2015-10-08 18:35:06 +01:00
Dominic Hamon e2327733e6 Merge pull request #150 from DiracResearch/visual-studio-warnings-fix
Visual studio warnings fix
2015-10-08 10:06:01 -07:00
Anton Danielsson 5cced076d2 Fixed int to char warning. 2015-10-08 10:48:40 +02:00
Anton Danielsson fcf4e99e01 Use IsWindowsXPOrGreater instead of the deprecated GetVersionEx. 2015-10-08 10:48:34 +02:00
Anton Danielsson e605cb0802 Changed "while(true)" to "for(;;)" to avoid warning in visual studio. 2015-10-08 10:48:32 +02:00
Anton Danielsson 2589e69e05 Fixed double to float warning. 2015-10-08 10:48:22 +02:00
Anton Danielsson e7f6c42a79 Fixed bug in "ToExponentAndMantissa" when negative exponents where created.
Unary minus where applied to an unsigned type.
2015-10-08 10:48:19 +02:00
Anton Danielsson a822c71655 Removed default constructor, copy constructor and assignment operator for CheckHandler. 2015-10-08 10:48:16 +02:00
Anton Danielsson 96ca9a7aba Fixed int64 to double cast warning. 2015-10-08 10:48:01 +02:00
Anton Danielsson ba141ac0d9 Renamed the internal os macros to avoid a name clash in Shlwapi.h where OS_WINDOWS is defined to 0. 2015-10-08 10:47:49 +02:00
izaid 14c4ce5ebf Removed unneeded #include <cstddef> 2015-10-06 15:10:15 +01:00
Eric Fiselier 3dd14f0724 Make the type of kMaxIterations consistent with the type of the iteration count 2015-10-01 18:46:39 -06:00
Eric Fiselier ed0a2eb741 use size_t instead of int for the iteration count 2015-10-01 15:08:44 -06:00
Eric Fiselier bcb933a9fb dynamically allocate WallTimeImp 2015-10-01 14:53:46 -06:00
Eric Fiselier e0441ef5d0 Merge branch 'master' into remove-check 2015-10-01 14:52:46 -06:00
Greg Miller 2463339d0b Updates Initialize() to work with an argv as 'char**' 2015-09-30 16:14:50 -04:00
Jean-Louis Leroy 11042c7fe7 Remove unused FormatKV(..., size_t) overload. 2015-09-25 09:37:03 -04:00
Jean-Louis Leroy 0f5503e9a2 Address Dominic's (stylistic) remarks. 2015-09-08 15:37:07 -04:00
Eric Fiselier a69f566e0a Remove std::is_trivially_destructible assertion because the trait may not be provided by the STL. 2015-09-07 19:33:23 -06:00
Jean-Louis Leroy 5ec78d7d44 Do not CpuScalingEnabled on Windows. 2015-09-03 15:11:12 -04:00
Jean-Louis Leroy cf830f731f Fix division in CPU usage calculation on Windows. 2015-09-03 15:11:11 -04: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
Jean-Louis Leroy 693967fe19 Remove unnecessary `typename'. 2015-09-03 15:11:08 -04:00
Kaito Udagawa 72ce39de3e Fix the compilation error against G++ on Mac OS X.
Using `0` as a null pointer is illegal when `-Wzero-as-null-pointer-constant`
is given to G++.  To avoid the warning `zero-as-null-pointer-constant`,
`nullptr` (C++11 keyword) instead of `0` is used in the `sysctl` invocation.
2015-06-13 19:34:20 +09:00
myd7349 9afa6c986c Fix issue #127 2015-06-05 09:25:11 +08: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
Dominic Hamon 1e0ed3a21c Rearrange the pieces 2015-04-03 13:33:54 -07:00
Geoff Romer dcb1a3dad4 Drop down to CMake 2.8.11, and drop INTERFACE since that version doesn't
support it.
2015-04-03 13:30:59 -07:00
Geoff Romer 3078ce9bc5 Link pthread as an INTERFACE library. 2015-04-03 13:30:59 -07:00
Geoff Romer 89a1edae15 Require cmake 2.8.12 in order to support target_include_directories, and
simplify thread linking logic.
2015-04-03 13:30:59 -07:00
Geoff Romer a6ad799a4d Configure 'benchmark' cmake target so that when other targets depend on it,
they get the appropriate include directories and link libraries automatically.
2015-04-03 13:30:59 -07:00
Eric Fiselier 8fcfa81d51 Fix comment about linking threading 2015-04-01 11:40:22 -04:00
Eric Fiselier 8bb991d099 Remove BENCHMARK_ENABLE_SHARED and prefer BUILD_SHARED_LIBS 2015-04-01 11:34:38 -04:00
Dominic Hamon 9934396e1f Add missing paranthesis and documentation 2015-04-01 10:51:37 -04:00
Matt Clarkson d676c5b375 Libraries are treated as runtime objects on Windows
When the library is created as a *.dll on Windows it is treated like a
runtime object so we must proivde the destination for the runtime
objects in our install command
2015-04-01 10:57:08 +01:00
Dominic Hamon 25e46848f9 Clarify build type warning 2015-03-31 14:43:38 -04:00
Eric 006d23ccca Merge pull request #108 from google/list-tests
Add --benchmark_list_tests option and change filter to match generated name.
2015-03-31 14:16:58 -04:00
Eric Fiselier ba1becca1a Add braces for one line conditionals and loops 2015-03-31 13:28:41 -04:00
Matt Clarkson b2a43b491c NT definition of MyCPUUsage and ChildrenCPUUsage
The children CPU usage doesn't seem to have a equivalent on NT systems
so it just returns zero.
2015-03-31 10:13:10 +01:00
Matt Clarkson 05eb1f2545 Use int64_t rather than int64
For cross platform and cross compiler portability we use the
standard integer type for a 64-bit integer. MinGW on Windows doesn't
have the definition for `int64`.
2015-03-31 10:13:09 +01:00
Matt Clarkson 65a5ebd638 Use the WINAPI Sleep function 2015-03-31 10:13:09 +01:00