forked from JacksonAllan/c_cpp_hash_tables_benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.h
More file actions
86 lines (75 loc) · 3.17 KB
/
config.h
File metadata and controls
86 lines (75 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// c_cpp_hash_tables_benchmark/config.h
// Copyright (c) 2024 Jackson L. Allan.
// Distributed under the MIT License (see the accompanying LICENSE file).
// The total number of unique keys to include in the benchmarks.
#define KEY_COUNT 200000
// The frequency at which to measure and record times.
// This must be a factor of KEY_COUNT.
#define KEY_COUNT_MEASUREMENT_INTERVAL 500
// The number of benchmarked operations/iterations
#define OP_COUNT 500
#define ITER_COUNT 5000
// The number of times to repeat the benchmarks.
#define RUN_COUNT 14
// Each data point in the outputted graphs is the average of the measurements for that point across all runs, excluding
// the lowest and highest measurements.
// This macro specifies the total number of measurements to discard (e.g. 2 means that the lowest measurement and
// highest measurement will be discarded).
// It should be an even number below RUN_COUNT.
// This mechanism reduces the impact of background noise interfering with the benchmarks.
#define DISCARDED_RUNS_COUNT 4
// The maximum load factor that all shims should, in theory, apply when initializing their maps.
// In reality, some hash map libraries do not allow custom load factors.
#define MAX_LOAD_FACTOR 0.875
// The size (in bytes) of the buffer to iterate over between maps in order to reset the state of the L1, L2, and L3 CPU
// caches.
// This mechanism is intended to ensure that each map starts the benchmarks under approximately the same condition with
// regard to whether the keys are cached.
#define APPROXIMATE_CACHE_SIZE 25000000
// The amount of time to sleep between benchmarks.
// #define MILLISECOND_COOLDOWN_BETWEEN_BENCHMARKS 1000
// The specific benchmarks to run (comment them out to disable them).
#define BENCHMARK_INSERT_NONEXISTING
#define BENCHMARK_REINSERT_NONEXISTING
#define BENCHMARK_ERASE_EXISTING
#define BENCHMARK_INSERT_EXISTING
// #define BENCHMARK_ERASE_NONEXISTING
#define BENCHMARK_GET_EXISTING
#define BENCHMARK_GET_NONEXISTING
#define BENCHMARK_ITERATION
// Blueprint slots.
#define BLUEPRINT_1 uint32_uint32_murmur
#define BLUEPRINT_2 uint64_struct448_murmur
#define BLUEPRINT_3 cstring_uint64_fnv1a
// #define BLUEPRINT_3 stdstring_uint64_fnv1a // C++ only
// #define BLUEPRINT_4
// #define BLUEPRINT_5
// #define BLUEPRINT_6
// #define BLUEPRINT_7
// #define BLUEPRINT_8
// #define BLUEPRINT_9
// #define BLUEPRINT_10
// #define BLUEPRINT_11
// #define BLUEPRINT_12
// #define BLUEPRINT_13
// #define BLUEPRINT_14
// #define BLUEPRINT_15
// #define BLUEPRINT_16
// Shim slots.
#define SHIM_1 absl_flat_hash_map
#define SHIM_2 ankerl_unordered_dense
#define SHIM_3 boost_unordered_flat_map
#define SHIM_4 emilib2O // emilib2 does not automatically respect MAX_LOAD_FACTOR (the header must be modified).
#define SHIM_5 ska_bytell_hash_map
#define SHIM_6 std_unordered_map
#define SHIM_7 tsl_robin_map
#define SHIM_8 cc_lib_map
#define SHIM_9 khash
#define SHIM_10 mlib_dict
#define SHIM_11 mlib_dict_oa
#define SHIM_12 stb_ds_hm_sh // stb_ds does not automatically respect MAX_LOAD_FACTOR (the header must be modified).
#define SHIM_13 stc_hmap
#define SHIM_14 uthash
#define SHIM_15 verstable
// #define SHIM_16 indivi_flat_umap
// #define SHIM_17 indivi_flat_wmap