16#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5
17#define IS_TRIVIALLY_CONSTRUCTIBLE std::has_trivial_default_constructor
19#define IS_TRIVIALLY_CONSTRUCTIBLE std::is_trivially_default_constructible
28static_assert(!IS_TRIVIALLY_CONSTRUCTIBLE<nontrivial_t>::value,
29 "expected nontrivial_t to not be trivially constructible");
32static_assert(IS_TRIVIALLY_CONSTRUCTIBLE<trivial_t>::value,
33 "expected trivial_t to be trivially constructible");
71 for (
auto x = 0; x < 900; ++x) {
75 for (
auto x = 0; x < 101; ++x) {
80 for (
auto x = 0; x < 1000; ++x) {
90 std::vector<prevector<CScriptBase::STATIC_SIZE, T>> vec;
92 for (
size_t i = 0; i < 260; ++i) {
101 std::vector<prevector<CScriptBase::STATIC_SIZE, T>> vec;
103 for (
size_t i = 0; i < 260; ++i) {
110#define PREVECTOR_TEST(name) \
111 static void Prevector##name##Nontrivial(benchmark::Bench &bench) { \
112 Prevector##name<nontrivial_t>(bench); \
114 BENCHMARK(Prevector##name##Nontrivial); \
115 static void Prevector##name##Trivial(benchmark::Bench &bench) { \
116 Prevector##name<trivial_t>(bench); \
118 BENCHMARK(Prevector##name##Trivial);
Double ended buffer combining vector and stream-like interfaces.
Main entry point to nanobench's benchmarking facility.
ANKERL_NANOBENCH(NODISCARD) std Bench & batch(T b) noexcept
Sets the batch size.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
Implements a drop-in replacement for std::vector<T> which stores up to N elements directly (without h...
static constexpr unsigned int STATIC_SIZE
void resize(size_type new_size)
static void PrevectorFillVectorIndirect(benchmark::Bench &bench)
static void PrevectorResize(benchmark::Bench &bench)
static void PrevectorFillVectorDirect(benchmark::Bench &bench)
static void PrevectorDestructor(benchmark::Bench &bench)
static void PrevectorClear(benchmark::Bench &bench)
#define PREVECTOR_TEST(name)
static void PrevectorDeserialize(benchmark::Bench &bench)
SERIALIZE_METHODS(nontrivial_t, obj)