11#include <unordered_map>
14template <
typename Map>
17 size_t batch_size = 5000;
24 for (
size_t i = 0; i < batch_size; ++i) {
33 auto map = std::unordered_map<uint64_t, uint64_t>();
39 using Map = std::unordered_map<uint64_t,
42 std::equal_to<uint64_t>,
44 sizeof(std::pair<const uint64_t, uint64_t>) + 4 *
sizeof(
void*)>>;
47 auto pool_resource = Map::allocator_type::ResourceType();
48 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)