8#include <unordered_map>
10template <
typename Map>
12 size_t batch_size = 5000;
20 for (
size_t i = 0; i < batch_size; ++i) {
28 auto map = std::unordered_map<uint64_t, uint64_t>();
34 using Map = std::unordered_map<
35 uint64_t, uint64_t, std::hash<uint64_t>, std::equal_to<uint64_t>,
37 sizeof(std::pair<const uint64_t, uint64_t>) +
42 auto pool_resource = Map::allocator_type::ResourceType();
43 auto map = Map{0, std::hash<uint64_t>{}, std::equal_to<uint64_t>{},
Forwards all allocations/deallocations to the PoolResource.
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.
ANKERL_NANOBENCH(NODISCARD) std Bench & minEpochIterations(uint64_t numIters) noexcept
Sets the minimum number of iterations each epoch should take.
An extremely fast random generator.
void BenchFillClearMap(benchmark::Bench &bench, Map &map)
static void PoolAllocator_StdUnorderedMapWithPoolResource(benchmark::Bench &bench)
static void PoolAllocator_StdUnorderedMap(benchmark::Bench &bench)
BENCHMARK(PoolAllocator_StdUnorderedMap)