C++ benchmark tool. Practical, stable and fast performance testing framework.
The cheapest to compile and the most popular part of sltbench is extracted to BenchCore.h
header. It significantly reduces compilation cost of sltbench code layer in comparison to Bench.h
. "Core" functionality covers:
SLTBENCH_FUNCTION
)SLTBENCH_MAIN
)Observed speedup on benchcompile metric:
dataset=simple, compilation time, sec | dataset=all, compilation time, sec | |
---|---|---|
sltbench 2.4.0 | 2.5 | 246.5 |
sltbench 2.3.0 | 17.9 | 261.7 |
(results are obtained on Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz, clang-6.0.0)
Usage:
// #include <sltbench/Bench.h> // compiles slower
#include <sltbench/BenchCore.h> // compiles faster
void BM_fun()
{
// ...
}
SLTBENCH_FUNCTION(BM_fun); // ok, simple function benchmark is core API
SLTBENCH_MAIN(); // ok, driver start is core API
Release goal is to improve benchmarks (not library!) compilation time in order to speedup development cycle for huge projects.
Improvements:
codebase | compilation time, sec |
---|---|
sltbench r-2.3.0 | 263.1 |
sltbench r-2.2.0 + benchcompile unification patch | 441.8 |
measured on Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz, clang-6.0, dataset=all
codebase | libsltbench.a size, Kb, gcc 7-5.0 |
---|---|
sltbench r-2.3.0 | 397 |
sltbench r-2.2.0 | 471 |
sltbench library is not targeting IOT devices obviously, so it was done just for achievement.
Followup notes:
std::string
to char*
and chrono::nanoseconds
to long long
). Change is under consideration because there shouldn't be big number of custom reporters in a wild. If it will be implemented it would be a major version update.std::string
using std::ostream
and arguments generators using std::vector
. Problem fix would require to change all argument-based benchmarks in user code and will never be implemented. It is a drawback of initial architecture decisions. Relying on STL in library API probably was a bad idea.The goal of this release is to introduce simplified API for managing fixtures.
New
SLTBENCH_FUNCTION_WITH_FIXTURE_BUILDER
. It allows simple fixtures without implementing custom Fixture
class. Variants with arguments and arguments generators are also provided.DoNotOptimize
utility function to prevent the code under testing being optimizated out by compiler.--name_prev
and --name_next
command line arguments of performance results comparator script allows to customize columns names with previous and next results.Changes
The goal of this release is the documentation regorganization. README looks huge. Documentation restructuring seems a good way to decrease sltbench intergration cost.
The goals of release 2.0.0:
Changes:
The goal of release 1.1.0 is to add lazy generators feature for memory-consuming benchmarks.
Hotfix
Initial release