Commit Graph

58 Commits

Author SHA1 Message Date
CrazyRong
f9e826db52 升级benchmark版本到版本火车要求的1.8.3版本
Signed-off-by: CrazyRong <zzr189911@163.com>
2024-04-20 16:24:00 +08:00
mipengwei
a0da9a7685 Signed-off-by:mipengwei <mipengwei@huawei.com> 2022-07-20 09:51:00 +08:00
Christian Wassermann
4857962394
Add CartesianProduct with associated test (#1029)
* Add CartesianProduct with associated test

* Use CartesianProduct in Ranges to avoid code duplication
* Add new cartesian_product_test to CMakeLists.txt
* Update AUTHORS & CONTRIBUTORS

* Rename CartesianProduct to ArgsProduct

* Rename test & fixture accordingly
* Add example for ArgsProduct to README
2020-08-25 13:47:44 +01:00
Jordan Williams
daff5fead3 Alias CMake Targets. Fixes #921 (#926)
* add Jordan Williams to both CONTRIBUTORS and AUTHORS

* alias benchmark libraries

Provide aliased CMake targets for the benchmark and benchmark_main targets.
The alias targets are namespaced under benchmark::, which is the namespace when they are exported.
I chose not to use either the PROJECT_NAME or the namespace variable but to hard-code the namespace.
This is because the benchmark and benchmark_main targets are hard-coded by name themselves.
Hard-coding the namespace is also much cleaner and easier to read.

* link to aliased benchmark targets

It is safer to link against namespaced targets because of how CMake interprets the double colon.
Typo's will be caught by CMake at configuration-time instead of during compile / link time.

* document the provided alias targets

* add "Usage with CMake" section in documentation

This section covers linking against the alias/import CMake targets and including them using either find_package or add_subdirectory.

* format the "Usage with CMake" README section

Added a newline after the "Usage with CMake" section header.
Dropped the header level of the section by one to make it a direct subsection of the "Usage" section.
Wrapped lines to be no longer than 80 characters in length.
2020-01-14 23:21:24 +03:00
Szitár Gergő
5ce2429af7 Add d postfix to Debug libraries (#923)
* Add DEBUG_POSTFIX to libraries.

Makes it possible to install Debug and Release versions on the
same system. Without this, there were only linker errors when using
the wrong configuration.

* Update CONTRIBUTORS and AUTHORS according to guide
2020-01-05 12:32:40 +00:00
Colin Braley
e7e3d976ef Add missing parenthesis to code sample, and fix spacing. (#877)
* Fix missing paren in README code sample, and fix code spacing.

* Add Colin Braley to AUTHORS and CONTRIBUTORS.
2019-09-21 23:55:05 +03:00
Geoffrey Martin-Noble
d2fc7fe659 Guard ASSERT_THROWS checks with BENCHMARK_HAS_NO_EXCEPTIONS (#874)
* Guard ASSERT_THROWS checks with BENCHMARK_HAS_NO_EXCEPTIONS

This allows the test be run with exceptions turned off

* Add myself to CONTRIBUTORS

I don't need to be added to AUTHORS, as I am a Google employee
2019-09-20 10:25:31 +01:00
Sayan Bhattacharjee
ffadb65d3a Documentation of basic use of DenseRange. (#855)
Documentation of basic use of `DenseRange` was added to README.md.
2019-08-21 09:51:31 -07:00
Eric Backus
32a1e39720 Bugfix/wsl selftest fixes. Fixes #839 (#843)
* Update AUTHORS and CONTRIBUTORS

* Fix WSL self-test failures

Some of the benchmark self-tests expect and check for a particular
output format from the benchmark library. The numerical values must
not be infinity or not-a-number, or the test will report an error.
Some of the values are computed bytes-per-second or items-per-second
values, so these require that the measured CPU time for the test to be
non-zero. But the loop that is being measured was empty, so the
measured CPU time for the loop was extremely small. On systems like
Windows Subsystem for Linux (WSL) the timer doesn't have enough
resolution to measure this, so the measured CPU time was zero.

This fix just makes sure that these tests have something within the
timing loop, so that the benchmark library will not decide that the
loop takes zero CPU time. This makes these tests more robust, and in
particular makes them pass on WSL.
2019-07-27 19:02:31 +03:00
astee
05d8c1c5d0 Improve README (#804)
* Update and organize README

* Update AUTHORS and CONTRIBUTORS

Fixes #803.
2019-04-25 14:48:56 +03:00
Hannes Hauswedell
415835e03e fix master branch on *BSD (#792)
* fix master branch on *BSD

* add name to CONTRIBUTORS
2019-04-11 16:36:11 +01:00
Daniel Harvey
f6e96861a3 BENCHMARK_CAPTURE() and Complexity() - naming problem (#761)
Created BenchmarkName class which holds the full benchmark
name and allows specifying and retrieving different components
of the name (e.g. ARGS, THREADS etc.)

Fixes #730.
2019-03-17 16:38:51 +03:00
Andriy Berestovskyy
4b9f43e2c4 Fix header lines length (#752)
Commit 17a012d7 added a newline to the str, so the line built from
str.length() is one character longer than it should be.
2019-01-13 17:26:49 +03:00
Cyrille
5cb8f8a03d Fix signed vs unsigned comparisons in string_util unit tests (#742)
Unit-tests fail to build due to the following errors:

/home/cfx/Dev/google-benchmark/benchmark.git/test/string_util_gtest.cc:12:5: required from here
/home/cfx/Applications/googletest-1.8.1/include/gtest/gtest.h:1444:11: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   if (lhs == rhs) {
       ~~~~^~~~~~

Fixes #741
2018-12-10 10:24:22 +00:00
Ori Livneh
e1150acab9 Add Ori Livneh to AUTHORS and CONTRIBUTORS 2018-07-09 10:52:28 -04:00
Federico Ficarelli
1f35fa4aa7 Update AUTHORS and CONTRIBUTORS (#632)
Adding myself to AUTHORS and CONTRIBUTORS according to guidelines.
2018-07-09 12:47:16 +01:00
Deniz Evrenci
6d74c0625b split_list is not defined for assembly tests (#595)
* Update AUTHORS and CONTRIBUTORS

* split_list is not defined for assembly tests
2018-05-14 15:02:49 +01:00
jmillikin-stripe
a9beffda0b Add support for building with Bazel. (#533)
* Add myself to CONTRIBUTORS under the corp CLA for Stripe, Inc.

* Add support for building with Bazel.

Limitations compared to existing CMake rules:
* Defaults to using C++11 `<regex>`, with an override via Bazel flag
  `--define` of `google_benchmark.have_regex`. The TravisCI config sets
  the regex implementation to `posix` because it uses ancient compilers.
* Debug vs Opt mode can't be set per test. TravisCI runs all the tests
  in debug mode to satisfy `diagnostics_test`, which depends on `CHECK`
  being live.

* Set Bazel workspace name so other repos can refer to it by stable name.

This is recommended by the Bazel style guide to avoid each dependent
workspace defining its own name for the dependency.
2018-03-08 12:48:46 +00:00
Robert Guo
ff2c255af5 Use STCK to get the CPU clock on s390x (#540) 2018-03-02 03:22:03 -08:00
Kishan Kumar
eae42212ce Added the installation guide for Ubuntu (#489)
* Initial CLA Requirement

* Added Installation steps to the Readme.md

* Fixed error in running benchmark of Installation

* Remove unwanted commands

Removed the lengthy install procedure with suggested install mechanism
2017-11-29 09:36:19 -08:00
Roman Lebedev
336bb8db98 Update AUTHORS/CONTRIBUTORS (#471)
As requested, in a pr form :)
2017-11-03 10:00:29 -07:00
Raúl Marín
cacd321808 Avoid implicit float to double conversion (#457)
Triggered by -Werror=double-promotion
2017-10-13 09:17:02 -07:00
Dominic Hamon
5d47e9878f Alphabets are hard. CONTRIBUTORS version.
#448
2017-09-27 11:52:47 -07:00
Dominic Hamon
359120be78 Order CONTRIBUTORS
Fixes #448
2017-09-27 20:01:10 +02:00
Tom Madams
ee3cfca651 Fix ThreadCPUUsage when running on RTEMS. (#414)
Change ThreadCPUUsage to call ProcessCPUUsage if __rtems__ is defined.

RTEMS real time OS doesn't support CLOCK_THREAD_CPUTIME_ID. See
https://github.com/RTEMS/rtems/blob/master/cpukit/posix/src/clockgettime.c#L58-L59

Prior to this change, ThreadCPUUsage would fail when running on RTEMS with:
  ERROR: clock_gettime(CLOCK_THREAD_CPUTIME_ID, ...) failed
2017-07-06 15:59:13 -07:00
Jern-Kuan Leong
710c2b89d8 Fix #403 HAVE_${VAR} not passed to makefile (#404)
Add definition of ${VAR} to makefiles if specified as part of cmake
parameter.
2017-06-16 14:46:11 -07:00
Yixuan Qiu
f3b3dd99be Use the sample version of standard deviation (#383)
* remove unnecessary weights

* use sample standard deviation

* add contributor information

* remove redundant code

* initialize variable to eliminate compiler warning
2017-06-05 10:32:15 -07:00
Ray Glover
17298b2dc0 Python 2/3 compatibility (#361)
* [tools] python 2/3 support

* update authors/contributors
2017-03-29 03:39:18 -07: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
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
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
Albert Pretorius
74e82e822f Force DoNotOptimize operand to memory for both gcc and clang 2016-05-26 07:43:07 +01:00
Dominic Hamon
a86545874a Merge branch 'ismaelJimenez-complexity' 2016-05-24 13:15:55 -07:00
Eric Fiselier
f434ce3fb6 Add myself to the CONTRIBUTORS file 2016-05-23 12:59:12 -06:00
Ismael
290bd60289 Refactor for pull request 2016-05-21 11:51:42 +02:00
Billy Robert O'Neal III
fa8b2d6171 Add myself to the contributors list 2016-05-10 16:46:26 -07:00
Jussi Knuuttila
e253a28402 Manual timing support. 2016-05-05 23:24:13 +03:00
Kai Wolf
3a02c462c7 Add myself to the contributors list 2016-03-24 22:34:23 +01:00
Dominik Czarnota
d2917bcded Fixes #165: CustomArguments ret type in README
* adds myself to AUTHORS/CONTRIBUTORS
2015-11-30 16:15:00 +01:00
ryobg
13a67d20e6 Add myself to AUTHORS and CONTRIBUTORS as requested wrt Fix #159. 2015-11-06 20:10:50 +02:00
Zbigniew Skowron
cd2e633fe5 Fix get_git_version to use GIT_EXECUTABLE.
get_git_version CMake function uses 'git' command directly, instead of
GIT_EXECUTABLE variable. This causes CMake errors while generating
project files in environments, where 'git' command is not present
in PATH.
2015-10-18 02:13:37 +02:00
Tobias Ulvgard
c06da04bcf Adds Dirac Research and me as Author and Contributor 2015-10-07 17:28:00 +02:00
Kaito Udagawa
f72d24942a Add Kaito Udagawa to AUTHORS and CONTRIBUTORS 2015-06-16 22:45:57 +09:00
Evgeny Safronov
1bc73789e4 Update AUTHORS and CONTRIBUTORS. 2014-11-14 23:39:38 +04:00
zjx20
0fcd190cd6 Update CONTRIBUTORS 2014-10-05 16:13:35 +08:00
Matt Clarkson
4fae2944c7 Added Matt Clarkson as a contributor 2014-07-30 18:06:52 +01:00
Matt Clarkson
ace6464b28 Made AUTHORS and CONTRIBUTES alphabetical 2014-07-30 18:06:52 +01:00
Lei Xu
0b19192fb0 Add Lei Xu to AUTHORS and CONTRIBUTORS 2014-07-25 08:15:46 -07:00
Pierre Phaneuf
c7eb316e7e Add @predmond to the AUTHORS and CONTRIBUTORS files. 2014-07-23 17:18:40 +01:00
pleroy
556002bec1 Adding myself to the contributors 2014-06-04 21:18:52 +02:00