22static_assert(!std::is_trivially_default_constructible_v<nontrivial_t>,
23 "expected nontrivial_t to not be trivially constructible");
26static_assert(std::is_trivially_default_constructible_v<trivial_t>,
27 "expected trivial_t to be trivially constructible");
32 bench.batch(2).run([&] {
45 bench.batch(2).run([&] {
58 bench.batch(4).run([&] {
72 for (
auto x = 0; x < 900; ++x) {
76 for (
auto x = 0; x < 101; ++x) {
79 bench.batch(1000).run([&] {
81 for (
auto x = 0; x < 1000; ++x) {
92 std::vector<prevector<CScriptBase::STATIC_SIZE, T>>
vec;
94 for (
size_t i = 0; i < 260; ++i) {
105 std::vector<prevector<CScriptBase::STATIC_SIZE, T>>
vec;
107 for (
size_t i = 0; i < 260; ++i) {
114#define PREVECTOR_TEST(name) \
115 static void Prevector##name##Nontrivial(benchmark::Bench& bench) \
117 Prevector##name<nontrivial_t>(bench); \
119 BENCHMARK(Prevector##name##Nontrivial); \
120 static void Prevector##name##Trivial(benchmark::Bench& bench) \
122 Prevector##name<trivial_t>(bench); \
124 BENCHMARK(Prevector##name##Trivial);
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)
Double ended buffer combining vector and stream-like interfaces.
Main entry point to nanobench's benchmarking facility.
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)
#define T(expected, seed, data)
SERIALIZE_METHODS(nontrivial_t, obj)
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.