14#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5
15#define IS_TRIVIALLY_CONSTRUCTIBLE std::has_trivial_default_constructor
17#define IS_TRIVIALLY_CONSTRUCTIBLE std::is_trivially_default_constructible
25static_assert(!IS_TRIVIALLY_CONSTRUCTIBLE<nontrivial_t>::value,
26 "expected nontrivial_t to not be trivially constructible");
29static_assert(IS_TRIVIALLY_CONSTRUCTIBLE<trivial_t>::value,
30 "expected trivial_t to be trivially constructible");
68 for (
auto x = 0; x < 900; ++x) {
72 for (
auto x = 0; x < 101; ++x) {
77 for (
auto x = 0; x < 1000; ++x) {
87 std::vector<prevector<28, T>> vec;
88 for (
size_t i = 0; i < 260; ++i) {
97 std::vector<prevector<28, T>> vec;
98 for (
size_t i = 0; i < 260; ++i) {
100 vec.emplace_back(29, T{});
105#define PREVECTOR_TEST(name) \
106 static void Prevector##name##Nontrivial(benchmark::Bench &bench) { \
107 Prevector##name<nontrivial_t>(bench); \
109 BENCHMARK(Prevector##name##Nontrivial); \
110 static void Prevector##name##Trivial(benchmark::Bench &bench) { \
111 Prevector##name<trivial_t>(bench); \
113 BENCHMARK(Prevector##name##Trivial);
Double ended buffer combining vector and stream-like interfaces.
bool Rewind(std::optional< size_type > n=std::nullopt)
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...
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)