Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
nanobench.h File Reference
#include <chrono>
#include <cstring>
#include <iosfwd>
#include <string>
#include <unordered_map>
#include <vector>
Include dependency graph for nanobench.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ankerl::nanobench::detail::PerfCountSet< T >
struct  ankerl::nanobench::Config
class  ankerl::nanobench::Result
class  ankerl::nanobench::Rng
 An extremely fast random generator. More...
class  ankerl::nanobench::Bench
 Main entry point to nanobench's benchmarking facility. More...
class  ankerl::nanobench::detail::IterationLogic
class  ankerl::nanobench::detail::PerformanceCounters
class  ankerl::nanobench::BigO

Namespaces

namespace  ankerl
namespace  ankerl::nanobench
namespace  ankerl::nanobench::templates
namespace  ankerl::nanobench::detail

Macros

#define ANKERL_NANOBENCH_VERSION_MAJOR   4
#define ANKERL_NANOBENCH_VERSION_MINOR   3
#define ANKERL_NANOBENCH_VERSION_PATCH   11
#define ANKERL_NANOBENCH(x)
#define ANKERL_NANOBENCH_PRIVATE_CXX()
#define ANKERL_NANOBENCH_PRIVATE_CXX98()
#define ANKERL_NANOBENCH_PRIVATE_CXX11()
#define ANKERL_NANOBENCH_PRIVATE_CXX14()
#define ANKERL_NANOBENCH_PRIVATE_CXX17()
#define ANKERL_NANOBENCH_PRIVATE_NODISCARD()
#define ANKERL_NANOBENCH_PRIVATE_IGNORE_PADDED_PUSH()
#define ANKERL_NANOBENCH_PRIVATE_IGNORE_PADDED_POP()
#define ANKERL_NANOBENCH_PRIVATE_IGNORE_EFFCPP_PUSH()
#define ANKERL_NANOBENCH_PRIVATE_IGNORE_EFFCPP_POP()
#define ANKERL_NANOBENCH_LOG(x)
#define ANKERL_NANOBENCH_PRIVATE_PERF_COUNTERS()
#define ANKERL_NANOBENCH_NO_SANITIZE(...)
#define ANKERL_NANOBENCH_PRIVATE_NOINLINE()
#define ANKERL_NANOBENCH_IS_TRIVIALLY_COPYABLE(...)
#define ANKERL_NANOBENCH_PRIVATE_NOEXCEPT_STRING_MOVE()

Typedefs

using ankerl::nanobench::Clock

Functions

void ankerl::nanobench::render (char const *mustacheTemplate, Bench const &bench, std::ostream &out)
 Renders output from a mustache-like template and benchmark results.
void ankerl::nanobench::render (std::string const &mustacheTemplate, Bench const &bench, std::ostream &out)
void ankerl::nanobench::render (char const *mustacheTemplate, std::vector< Result > const &results, std::ostream &out)
 Same as render(char const* mustacheTemplate, Bench const& bench, std::ostream& out), but for when you only have results available.
void ankerl::nanobench::render (std::string const &mustacheTemplate, std::vector< Result > const &results, std::ostream &out)
char const * ankerl::nanobench::templates::csv () noexcept
 CSV data for the benchmark results.
char const * ankerl::nanobench::templates::htmlBoxplot () noexcept
 HTML output that uses plotly to generate an interactive boxplot chart. See the tutorial for an example output.
char const * ankerl::nanobench::templates::pyperf () noexcept
 Output in pyperf compatible JSON format, which can be used for more analyzation.
char const * ankerl::nanobench::templates::json () noexcept
 Template to generate JSON data.
template<typename Arg>
void ankerl::nanobench::doNotOptimizeAway (Arg &&arg)
 Makes sure none of the given arguments are optimized away by the compiler.
template<typename T>
void ankerl::nanobench::detail::doNotOptimizeAway (T const &val)
template<typename T>
void ankerl::nanobench::detail::doNotOptimizeAway (T &val)
PerformanceCountersankerl::nanobench::detail::performanceCounters ()
std::ostream & ankerl::nanobench::operator<< (std::ostream &os, BigO const &bigO)
std::ostream & ankerl::nanobench::operator<< (std::ostream &os, std::vector< ankerl::nanobench::BigO > const &bigOs)

Macro Definition Documentation

◆ ANKERL_NANOBENCH

#define ANKERL_NANOBENCH ( x)
Value:
ANKERL_NANOBENCH_PRIVATE_##x()

Definition at line 49 of file nanobench.h.

◆ ANKERL_NANOBENCH_IS_TRIVIALLY_COPYABLE

#define ANKERL_NANOBENCH_IS_TRIVIALLY_COPYABLE ( ...)
Value:
std::is_trivially_copyable<__VA_ARGS__>::value

Definition at line 120 of file nanobench.h.

◆ ANKERL_NANOBENCH_LOG

#define ANKERL_NANOBENCH_LOG ( x)
Value:
do { \
} while (0)

Definition at line 87 of file nanobench.h.

◆ ANKERL_NANOBENCH_NO_SANITIZE

#define ANKERL_NANOBENCH_NO_SANITIZE ( ...)

Definition at line 106 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_CXX

#define ANKERL_NANOBENCH_PRIVATE_CXX ( )
Value:
__cplusplus

Definition at line 51 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_CXX11

#define ANKERL_NANOBENCH_PRIVATE_CXX11 ( )
Value:
201103L

Definition at line 53 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_CXX14

#define ANKERL_NANOBENCH_PRIVATE_CXX14 ( )
Value:
201402L

Definition at line 54 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_CXX17

#define ANKERL_NANOBENCH_PRIVATE_CXX17 ( )
Value:
201703L

Definition at line 55 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_CXX98

#define ANKERL_NANOBENCH_PRIVATE_CXX98 ( )
Value:
199711L

Definition at line 52 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_IGNORE_EFFCPP_POP

#define ANKERL_NANOBENCH_PRIVATE_IGNORE_EFFCPP_POP ( )

Definition at line 77 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_IGNORE_EFFCPP_PUSH

#define ANKERL_NANOBENCH_PRIVATE_IGNORE_EFFCPP_PUSH ( )

Definition at line 76 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_IGNORE_PADDED_POP

#define ANKERL_NANOBENCH_PRIVATE_IGNORE_PADDED_POP ( )

Definition at line 69 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_IGNORE_PADDED_PUSH

#define ANKERL_NANOBENCH_PRIVATE_IGNORE_PADDED_PUSH ( )

Definition at line 68 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_NODISCARD

#define ANKERL_NANOBENCH_PRIVATE_NODISCARD ( )

Definition at line 60 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_NOEXCEPT_STRING_MOVE

#define ANKERL_NANOBENCH_PRIVATE_NOEXCEPT_STRING_MOVE ( )
Value:
std::is_nothrow_move_assignable<std::string>::value

Definition at line 125 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_NOINLINE

#define ANKERL_NANOBENCH_PRIVATE_NOINLINE ( )
Value:
__attribute__((noinline))

Definition at line 112 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_PERF_COUNTERS

#define ANKERL_NANOBENCH_PRIVATE_PERF_COUNTERS ( )
Value:
0

Definition at line 92 of file nanobench.h.

◆ ANKERL_NANOBENCH_VERSION_MAJOR

#define ANKERL_NANOBENCH_VERSION_MAJOR   4

Definition at line 34 of file nanobench.h.

◆ ANKERL_NANOBENCH_VERSION_MINOR

#define ANKERL_NANOBENCH_VERSION_MINOR   3

Definition at line 35 of file nanobench.h.

◆ ANKERL_NANOBENCH_VERSION_PATCH

#define ANKERL_NANOBENCH_VERSION_PATCH   11

Definition at line 36 of file nanobench.h.