v4.5.0
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
Benchobjects writing to different streams overwrote each other's settings, and the second table came out with no header at all. - An unknown
Measurereads as no data instead of one slot past the end of the per-measure storage.Result::fromString()returnsMeasure::_sizefor a name it does not recognise, so this was reachable simply by resolving a measure from user input. BigOwith nothing to fit no longer divides by zero.complexityBigO()on aBenchwhere nocomplexityNwas set produced six all-NaN models, which then went tostd::sort.
Added
std::string_viewoverloads forBench::name()andBench::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 buildThat 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