ZeroErr
Loading...
Searching...
No Matches
benchmark.h File Reference
#include "zeroerr/internal/config.h"
#include <chrono>
#include <cstdint>
#include "zeroerr/string.h"
#include <vector>
Include dependency graph for benchmark.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  zeroerr::PerfCountSet< T >
 PerfCountSet is a set of performance counters. More...
struct  zeroerr::PerformanceCounter
 PerformanceCounter is a class to measure the performance of a function. More...
struct  zeroerr::BenchResult
 BenchResult is a result of running the benchmark. More...
struct  zeroerr::Benchmark
 Benchmark create a core object for configuration of a benchmark. This class is a driver to run multiple times of a benchmark. Each time of a run will generate a row of data. Report will print the data in console. More...

Namespaces

namespace  zeroerr
namespace  zeroerr::detail

Macros

#define ZEROERR_CREATE_BENCHMARK_FUNC(function, name, ...)
#define BENCHMARK(...)

Typedefs

using zeroerr::Clock

Functions

BenchState * zeroerr::createBenchState (Benchmark &benchmark)
void zeroerr::destroyBenchState (BenchState *state)
size_t zeroerr::getNumIter (BenchState *state)
void zeroerr::runIteration (BenchState *state)
void zeroerr::moveResult (BenchState *state, zeroerr::String name)
template<typename T>
void zeroerr::detail::doNotOptimizeAway (const T &val)
template<typename T>
void zeroerr::detail::doNotOptimizeAway (T &val)
template<typename Arg>
void zeroerr::doNotOptimizeAway (Arg &&arg)
 Makes sure none of the given arguments are optimized away by the compiler.

Macro Definition Documentation

◆ BENCHMARK

#define BENCHMARK ( ...)
Value:
ZEROERR_SUPPRESS_VARIADIC_MACRO \
ZEROERR_CREATE_BENCHMARK_FUNC(ZEROERR_NAMEGEN(_zeroerr_benchmark), __VA_ARGS__) \
#define ZEROERR_NAMEGEN(x)
Definition config.h:110
#define ZEROERR_SUPPRESS_VARIADIC_MACRO_POP
Definition config.h:316

◆ ZEROERR_CREATE_BENCHMARK_FUNC

#define ZEROERR_CREATE_BENCHMARK_FUNC ( function,
name,
... )
Value:
static void function(zeroerr::TestContext*); \
static zeroerr::detail::regTest ZEROERR_NAMEGEN(_zeroerr_reg)( \
{name, __FILE__, __LINE__, function, {__VA_ARGS__}}, zeroerr::TestType::bench); \
static void function(ZEROERR_UNUSED(zeroerr::TestContext* _ZEROERR_TEST_CONTEXT))
TestContext is a class that holds the test results and reporter context. There are 8 different matric...
Definition unittest.h:89
#define ZEROERR_UNUSED(x)
Definition config.h:360
@ bench
Definition unittest.h:297
regTest is a class that is used to register the test case. It will be used as global variables and th...
Definition unittest.h:305