Skip to content

v4.5.0

Choose a tag to compare

@martinus martinus released this 14 Aug 05:29
· 18 commits to master since this release

A minor release: two backwards-compatible features have landed since v4.4.0, along with three fixes and the packaging work a distribution formula needs.

Fixed

  • Each output stream gets its own table header state (#112). Two Bench objects writing to different streams overwrote each other's settings, and the second table came out with no header at all.
  • An unknown Measure reads as no data instead of one slot past the end of the per-measure storage. Result::fromString() returns Measure::_size for a name it does not recognise, so this was reachable simply by resolving a measure from user input.
  • BigO with nothing to fit no longer divides by zero. complexityBigO() on a Bench where no complexityN was set produced six all-NaN models, which then went to std::sort.

Added

  • std::string_view overloads for Bench::name() and Bench::run() (C++17 and later).
  • nanobench builds with exceptions disabled.

Packaging

cmake --install now uses the conventional locations, the test suite is optional via NANOBENCH_BUILD_TEST=OFF, and the CMake package ships nanobenchConfig.cmake plus a version file. For a distribution formula:

cmake -S . -B build -DNANOBENCH_BUILD_TEST=OFF
cmake --build build --target nanobench
cmake --install build

That installs nanobench.h, libnanobench.a and the package files. CMake minimum is 3.10; there are no dependencies beyond a C++11 compiler.

Internal

  • The performance counter arithmetic moved out of the Linux-only counter class. It is the part that can be silently wrong — a counter quietly 5% low looks exactly like a correct one — and it now compiles and is tested on every platform, while perf_event_open() stays behind the Linux guard.
  • Vendored doctest 2.4.11 → 2.5.3, gh-md-toc 0.6.1 → 0.10.0.
  • The test suite roughly doubled, 56 → 122 cases, and is now judged by whether it catches deliberately injected bugs rather than by line coverage alone.

Full changelog: v4.4.0...v4.5.0