Bitcoin Core  27.99.0
P2P Digital Currency
Classes | Namespaces | Macros | Typedefs | Functions
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

 ankerl
 
 ankerl::nanobench
 
 ankerl::nanobench::templates
 
 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)   ANKERL_NANOBENCH_PRIVATE_##x()
 
#define ANKERL_NANOBENCH_PRIVATE_CXX()   __cplusplus
 
#define ANKERL_NANOBENCH_PRIVATE_CXX98()   199711L
 
#define ANKERL_NANOBENCH_PRIVATE_CXX11()   201103L
 
#define ANKERL_NANOBENCH_PRIVATE_CXX14()   201402L
 
#define ANKERL_NANOBENCH_PRIVATE_CXX17()   201703L
 
#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()   0
 
#define ANKERL_NANOBENCH_NO_SANITIZE(...)
 
#define ANKERL_NANOBENCH_PRIVATE_NOINLINE()   __attribute__((noinline))
 
#define ANKERL_NANOBENCH_IS_TRIVIALLY_COPYABLE(...)   std::is_trivially_copyable<__VA_ARGS__>::value
 
#define ANKERL_NANOBENCH_PRIVATE_NOEXCEPT_STRING_MOVE()   std::is_nothrow_move_assignable<std::string>::value
 

Typedefs

using ankerl::nanobench::Clock = std::conditional< std::chrono::high_resolution_clock::is_steady, std::chrono::high_resolution_clock, std::chrono::steady_clock >::type
 

Functions

void ankerl::nanobench::render (char const *mustacheTemplate, Bench const &bench, std::ostream &out)
 Renders output from a mustache-like template and benchmark results. More...
 
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. More...
 
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. More...
 
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. More...
 
char const * ankerl::nanobench::templates::pyperf () noexcept
 Output in pyperf compatible JSON format, which can be used for more analyzation. More...
 
char const * ankerl::nanobench::templates::json () noexcept
 Template to generate JSON data. More...
 
template<typename Arg >
void ankerl::nanobench::doNotOptimizeAway (Arg &&arg)
 Makes sure none of the given arguments are optimized away by the compiler. More...
 
template<typename T >
void ankerl::nanobench::detail::doNotOptimizeAway (T const &val)
 
template<typename T >
void ankerl::nanobench::detail::doNotOptimizeAway (T &val)
 
PerformanceCounters & ankerl::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)    ANKERL_NANOBENCH_PRIVATE_##x()

Definition at line 49 of file nanobench.h.

◆ ANKERL_NANOBENCH_IS_TRIVIALLY_COPYABLE

#define ANKERL_NANOBENCH_IS_TRIVIALLY_COPYABLE (   ...)    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 ( )    __cplusplus

Definition at line 51 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_CXX11

#define ANKERL_NANOBENCH_PRIVATE_CXX11 ( )    201103L

Definition at line 53 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_CXX14

#define ANKERL_NANOBENCH_PRIVATE_CXX14 ( )    201402L

Definition at line 54 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_CXX17

#define ANKERL_NANOBENCH_PRIVATE_CXX17 ( )    201703L

Definition at line 55 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_CXX98

#define ANKERL_NANOBENCH_PRIVATE_CXX98 ( )    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 ( )    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 ( )    __attribute__((noinline))

Definition at line 112 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_PERF_COUNTERS

#define ANKERL_NANOBENCH_PRIVATE_PERF_COUNTERS ( )    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.