1. 31 Jul, 2017 1 commit
    • Suppress -Wodr on C++03 tests when LTO is enabled. · abafced9
      Eric Fiselier authored
      The benchmark library is compiled as C++11, but certain
      tests are compiled as C++03. When -flto is enabled GCC 5.4
      and above will diagnose an ODR violation in libstdc++'s <map>.
      
      This ODR violation, although real, should likely be benign. For
      this reason it seems sensible to simply suppress -Wodr when building
      the C++03 test.
      
      This patch fixes #420 and supersede's PR #424.
  2. 25 Jul, 2017 1 commit
    • Tooling: generate_difference_report(): show old/new for both values (#427) · d474450b
      Roman Lebedev authored
      While the percentages are displayed for both of the columns,
      the old/new values are only displayed for the second column,
      for the CPU time. And the column is not even spelled out.
      
      In cases where b->UseRealTime(); is used, this is at the
      very least highly confusing. So why don't we just
      display both the old/new for both the columns?
      
      Fixes #425
  3. 24 Jul, 2017 1 commit
    • Json reporter: don't cast floating-point to int; adjust tooling (#426) · b9be142d
      Roman Lebedev authored
      * Json reporter: passthrough fp, don't cast it to int; adjust tooling
      
      Json output format is generally meant for further processing
      using some automated tools. Thus, it makes sense not to
      intentionally limit the precision of the values contained
      in the report.
      
      As it can be seen, FormatKV() for doubles, used %.2f format,
      which was meant to preserve at least some of the precision.
      However, before that function is ever called, the doubles
      were already cast to the integer via RoundDouble()...
      
      This is also the case for console reporter, where it makes
      sense because the screen space is limited, and this reporter,
      however the CSV reporter does output some( decimal digits.
      
      Thus i can only conclude that the loss of the precision
      was not really considered, so i have decided to adjust the
      code of the json reporter to output the full fp precision.
      
      There can be several reasons why that is the right thing
      to do, the bigger the time_unit used, the greater the
      precision loss, so i'd say any sort of further processing
      (like e.g. tools/compare_bench.py does) is best done
      on the values with most precision.
      
      Also, that cast skewed the data away from zero, which
      i think may or may not result in false- positives/negatives
      in the output of tools/compare_bench.py
      
      * Json reporter: FormatKV(double): address review note
      
      * tools/gbench/report.py: skip benchmarks with different time units
      
      While it may be useful to teach it to operate on the
      measurements with different time units, which is now
      possible since floats are stored, and not the integers,
      but for now at least doing such a sanity-checking
      is better than providing misinformation.
  4. 14 Jul, 2017 1 commit
  5. 13 Jul, 2017 1 commit
  6. 06 Jul, 2017 1 commit
  7. 04 Jul, 2017 1 commit
    • Make Benchmark a single header library (but not header-only) (#407) · 9d4b719d
      Eric authored
      * Make Benchmark a single header library (but not header-only)
      
      This patch refactors benchmark into a single header, to allow
      for slightly easier usage.
      
      The initial reason for the header split was to keep C++ library
      components from being included by benchmark_api.h, making that
      part of the library STL agnostic. However this has since changed
      and there seems to be little reason to separate the reporters from
      the rest of the library.
      
      * Fix internal_macros.h
      
      * Remove more references to macros.h
  8. 16 Jun, 2017 1 commit
  9. 14 Jun, 2017 3 commits
    • Add ClearRegisteredBenchmark() function. (#402) · b8a2206f
      Eric authored
      * Add ClearRegisteredBenchmark() function.
      
      Since benchmarks can be registered at runtime using the RegisterBenchmark(...)
      functions, it makes sense to have a ClearRegisteredBenchmarks() function too,
      that can be used at runtime to clear the currently registered benchmark and
      re-register an entirely new set.
      
      This allows users to run a set of registered benchmarks, get the output using
      a custom reporter, and then clear and re-register new benchmarks based on the
      previous results.
      
      This fixes issue #400, at least partially.
      
      * Remove unused change
    • Revert "Use NEW settings for CMP0063 policy (#399)" (#401) · d6aacaf4
      Eric authored
      This reverts commit af542061.
    • Use NEW settings for CMP0063 policy (#399) · af542061
      Tim authored
      This removes warnings when using CMake >= 3.3 if you have symbol visibility set.
  10. 05 Jun, 2017 1 commit
  11. 02 Jun, 2017 1 commit
    • Fix #342: DoNotOptimize causes compile errors on older GCC versions. (#398) · 93bfabc8
      Eric authored
      * Fix #342: DoNotOptimize causes compile errors on older GCC versions.
      
      DoNotOptimize uses inline assembly contraints to tell
      the compiler what the type of the input variable. The 'g'
      operand allows the input to be any register, memory, or
      immediate integer operand. However this constraint seems
      to be too weak on older GCC versions, and certain inputs
      will cause compile errors.
      
      This patch changes the constraint to 'X', which is documented
      as "any operand whatsoever is allowed". This appears to fix
      the issues with older GCC versions.
      
      However Clang doesn't seem to like "X", and will attempt
      to put the input into a register even when it can't/shouldn't;
      causing a compile error. However using "g" seems to work like
      "X" with GCC, so for this reason Clang still uses "g".
      
      * Try alternative formulation to placate GCC
  12. 23 May, 2017 1 commit
  13. 22 May, 2017 2 commits
  14. 04 May, 2017 1 commit
  15. 03 May, 2017 1 commit
  16. 02 May, 2017 16 commits
  17. 01 May, 2017 6 commits