Bitcoin ABC 0.30.5
P2P Digital Currency
Classes | Namespaces | Macros | Typedefs | Functions
nanobench.h File Reference
#include <chrono>
#include <cstring>
#include <iosfwd>
#include <string>
#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   6
 
#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
 

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 analyzations. 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 48 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 119 of file nanobench.h.

◆ ANKERL_NANOBENCH_LOG

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

Definition at line 86 of file nanobench.h.

◆ ANKERL_NANOBENCH_NO_SANITIZE

#define ANKERL_NANOBENCH_NO_SANITIZE (   ...)

Definition at line 105 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_CXX

#define ANKERL_NANOBENCH_PRIVATE_CXX ( )    __cplusplus

Definition at line 50 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_CXX11

#define ANKERL_NANOBENCH_PRIVATE_CXX11 ( )    201103L

Definition at line 52 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_CXX14

#define ANKERL_NANOBENCH_PRIVATE_CXX14 ( )    201402L

Definition at line 53 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_CXX17

#define ANKERL_NANOBENCH_PRIVATE_CXX17 ( )    201703L

Definition at line 54 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_CXX98

#define ANKERL_NANOBENCH_PRIVATE_CXX98 ( )    199711L

Definition at line 51 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_IGNORE_EFFCPP_POP

#define ANKERL_NANOBENCH_PRIVATE_IGNORE_EFFCPP_POP ( )

Definition at line 76 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_IGNORE_EFFCPP_PUSH

#define ANKERL_NANOBENCH_PRIVATE_IGNORE_EFFCPP_PUSH ( )

Definition at line 75 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_IGNORE_PADDED_POP

#define ANKERL_NANOBENCH_PRIVATE_IGNORE_PADDED_POP ( )

Definition at line 68 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_IGNORE_PADDED_PUSH

#define ANKERL_NANOBENCH_PRIVATE_IGNORE_PADDED_PUSH ( )

Definition at line 67 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_NODISCARD

#define ANKERL_NANOBENCH_PRIVATE_NODISCARD ( )

Definition at line 59 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_NOINLINE

#define ANKERL_NANOBENCH_PRIVATE_NOINLINE ( )    __attribute__((noinline))

Definition at line 111 of file nanobench.h.

◆ ANKERL_NANOBENCH_PRIVATE_PERF_COUNTERS

#define ANKERL_NANOBENCH_PRIVATE_PERF_COUNTERS ( )    0

Definition at line 91 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   6

Definition at line 36 of file nanobench.h.