8 #include <unordered_map>
10 template <
typename Map>
13 size_t batch_size = 5000;
20 for (
size_t i = 0; i < batch_size; ++i) {
29 auto map = std::unordered_map<uint64_t, uint64_t>();
35 using Map = std::unordered_map<uint64_t,
38 std::equal_to<uint64_t>,
40 sizeof(std::pair<const uint64_t, uint64_t>) + 4 *
sizeof(
void*),
44 auto pool_resource = Map::allocator_type::ResourceType();
45 auto map = Map{0, std::hash<uint64_t>{}, std::equal_to<uint64_t>{}, &pool_resource};
Forwards all allocations/deallocations to the PoolResource.
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
Bench & batch(T b) noexcept
Sets the batch size.
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)
BENCHMARK(PoolAllocator_StdUnorderedMap, benchmark::PriorityLevel::HIGH)
static void PoolAllocator_StdUnorderedMap(benchmark::Bench &bench)