1*58b9f456SAndroid Build Coastguard Worker #include <unordered_set>
2*58b9f456SAndroid Build Coastguard Worker #include <vector>
3*58b9f456SAndroid Build Coastguard Worker #include <functional>
4*58b9f456SAndroid Build Coastguard Worker #include <cstdint>
5*58b9f456SAndroid Build Coastguard Worker #include <cstdlib>
6*58b9f456SAndroid Build Coastguard Worker #include <cstring>
7*58b9f456SAndroid Build Coastguard Worker
8*58b9f456SAndroid Build Coastguard Worker #include "benchmark/benchmark.h"
9*58b9f456SAndroid Build Coastguard Worker
10*58b9f456SAndroid Build Coastguard Worker #include "ContainerBenchmarks.hpp"
11*58b9f456SAndroid Build Coastguard Worker #include "GenerateInput.hpp"
12*58b9f456SAndroid Build Coastguard Worker #include "test_macros.h"
13*58b9f456SAndroid Build Coastguard Worker
14*58b9f456SAndroid Build Coastguard Worker using namespace ContainerBenchmarks;
15*58b9f456SAndroid Build Coastguard Worker
16*58b9f456SAndroid Build Coastguard Worker constexpr std::size_t TestNumInputs = 1024;
17*58b9f456SAndroid Build Coastguard Worker
18*58b9f456SAndroid Build Coastguard Worker template <class _Size>
19*58b9f456SAndroid Build Coastguard Worker inline TEST_ALWAYS_INLINE
loadword(const void * __p)20*58b9f456SAndroid Build Coastguard Worker _Size loadword(const void* __p) {
21*58b9f456SAndroid Build Coastguard Worker _Size __r;
22*58b9f456SAndroid Build Coastguard Worker std::memcpy(&__r, __p, sizeof(__r));
23*58b9f456SAndroid Build Coastguard Worker return __r;
24*58b9f456SAndroid Build Coastguard Worker }
25*58b9f456SAndroid Build Coastguard Worker
26*58b9f456SAndroid Build Coastguard Worker inline TEST_ALWAYS_INLINE
rotate_by_at_least_1(std::size_t __val,int __shift)27*58b9f456SAndroid Build Coastguard Worker std::size_t rotate_by_at_least_1(std::size_t __val, int __shift) {
28*58b9f456SAndroid Build Coastguard Worker return (__val >> __shift) | (__val << (64 - __shift));
29*58b9f456SAndroid Build Coastguard Worker }
30*58b9f456SAndroid Build Coastguard Worker
31*58b9f456SAndroid Build Coastguard Worker inline TEST_ALWAYS_INLINE
hash_len_16(std::size_t __u,std::size_t __v)32*58b9f456SAndroid Build Coastguard Worker std::size_t hash_len_16(std::size_t __u, std::size_t __v) {
33*58b9f456SAndroid Build Coastguard Worker const std::size_t __mul = 0x9ddfea08eb382d69ULL;
34*58b9f456SAndroid Build Coastguard Worker std::size_t __a = (__u ^ __v) * __mul;
35*58b9f456SAndroid Build Coastguard Worker __a ^= (__a >> 47);
36*58b9f456SAndroid Build Coastguard Worker std::size_t __b = (__v ^ __a) * __mul;
37*58b9f456SAndroid Build Coastguard Worker __b ^= (__b >> 47);
38*58b9f456SAndroid Build Coastguard Worker __b *= __mul;
39*58b9f456SAndroid Build Coastguard Worker return __b;
40*58b9f456SAndroid Build Coastguard Worker }
41*58b9f456SAndroid Build Coastguard Worker
42*58b9f456SAndroid Build Coastguard Worker
43*58b9f456SAndroid Build Coastguard Worker template <std::size_t _Len>
44*58b9f456SAndroid Build Coastguard Worker inline TEST_ALWAYS_INLINE
hash_len_0_to_8(const char * __s)45*58b9f456SAndroid Build Coastguard Worker std::size_t hash_len_0_to_8(const char* __s) {
46*58b9f456SAndroid Build Coastguard Worker static_assert(_Len == 4 || _Len == 8, "");
47*58b9f456SAndroid Build Coastguard Worker const uint64_t __a = loadword<uint32_t>(__s);
48*58b9f456SAndroid Build Coastguard Worker const uint64_t __b = loadword<uint32_t>(__s + _Len - 4);
49*58b9f456SAndroid Build Coastguard Worker return hash_len_16(_Len + (__a << 3), __b);
50*58b9f456SAndroid Build Coastguard Worker }
51*58b9f456SAndroid Build Coastguard Worker
52*58b9f456SAndroid Build Coastguard Worker struct UInt32Hash {
53*58b9f456SAndroid Build Coastguard Worker UInt32Hash() = default;
54*58b9f456SAndroid Build Coastguard Worker inline TEST_ALWAYS_INLINE
operator ()UInt32Hash55*58b9f456SAndroid Build Coastguard Worker std::size_t operator()(uint32_t data) const {
56*58b9f456SAndroid Build Coastguard Worker return hash_len_0_to_8<4>(reinterpret_cast<const char*>(&data));
57*58b9f456SAndroid Build Coastguard Worker }
58*58b9f456SAndroid Build Coastguard Worker };
59*58b9f456SAndroid Build Coastguard Worker
60*58b9f456SAndroid Build Coastguard Worker struct UInt64Hash {
61*58b9f456SAndroid Build Coastguard Worker UInt64Hash() = default;
62*58b9f456SAndroid Build Coastguard Worker inline TEST_ALWAYS_INLINE
operator ()UInt64Hash63*58b9f456SAndroid Build Coastguard Worker std::size_t operator()(uint64_t data) const {
64*58b9f456SAndroid Build Coastguard Worker return hash_len_0_to_8<8>(reinterpret_cast<const char*>(&data));
65*58b9f456SAndroid Build Coastguard Worker }
66*58b9f456SAndroid Build Coastguard Worker };
67*58b9f456SAndroid Build Coastguard Worker
68*58b9f456SAndroid Build Coastguard Worker struct UInt128Hash {
69*58b9f456SAndroid Build Coastguard Worker UInt128Hash() = default;
70*58b9f456SAndroid Build Coastguard Worker inline TEST_ALWAYS_INLINE
operator ()UInt128Hash71*58b9f456SAndroid Build Coastguard Worker std::size_t operator()(__uint128_t data) const {
72*58b9f456SAndroid Build Coastguard Worker const __uint128_t __mask = static_cast<std::size_t>(-1);
73*58b9f456SAndroid Build Coastguard Worker const std::size_t __a = (std::size_t)(data & __mask);
74*58b9f456SAndroid Build Coastguard Worker const std::size_t __b = (std::size_t)((data & (__mask << 64)) >> 64);
75*58b9f456SAndroid Build Coastguard Worker return hash_len_16(__a, rotate_by_at_least_1(__b + 16, 16)) ^ __b;
76*58b9f456SAndroid Build Coastguard Worker }
77*58b9f456SAndroid Build Coastguard Worker };
78*58b9f456SAndroid Build Coastguard Worker
79*58b9f456SAndroid Build Coastguard Worker struct UInt32Hash2 {
80*58b9f456SAndroid Build Coastguard Worker UInt32Hash2() = default;
81*58b9f456SAndroid Build Coastguard Worker inline TEST_ALWAYS_INLINE
operator ()UInt32Hash282*58b9f456SAndroid Build Coastguard Worker std::size_t operator()(uint32_t data) const {
83*58b9f456SAndroid Build Coastguard Worker const uint32_t __m = 0x5bd1e995;
84*58b9f456SAndroid Build Coastguard Worker const uint32_t __r = 24;
85*58b9f456SAndroid Build Coastguard Worker uint32_t __h = 4;
86*58b9f456SAndroid Build Coastguard Worker uint32_t __k = data;
87*58b9f456SAndroid Build Coastguard Worker __k *= __m;
88*58b9f456SAndroid Build Coastguard Worker __k ^= __k >> __r;
89*58b9f456SAndroid Build Coastguard Worker __k *= __m;
90*58b9f456SAndroid Build Coastguard Worker __h *= __m;
91*58b9f456SAndroid Build Coastguard Worker __h ^= __k;
92*58b9f456SAndroid Build Coastguard Worker __h ^= __h >> 13;
93*58b9f456SAndroid Build Coastguard Worker __h *= __m;
94*58b9f456SAndroid Build Coastguard Worker __h ^= __h >> 15;
95*58b9f456SAndroid Build Coastguard Worker return __h;
96*58b9f456SAndroid Build Coastguard Worker }
97*58b9f456SAndroid Build Coastguard Worker };
98*58b9f456SAndroid Build Coastguard Worker
99*58b9f456SAndroid Build Coastguard Worker struct UInt64Hash2 {
100*58b9f456SAndroid Build Coastguard Worker UInt64Hash2() = default;
101*58b9f456SAndroid Build Coastguard Worker inline TEST_ALWAYS_INLINE
operator ()UInt64Hash2102*58b9f456SAndroid Build Coastguard Worker std::size_t operator()(uint64_t data) const {
103*58b9f456SAndroid Build Coastguard Worker return hash_len_0_to_8<8>(reinterpret_cast<const char*>(&data));
104*58b9f456SAndroid Build Coastguard Worker }
105*58b9f456SAndroid Build Coastguard Worker };
106*58b9f456SAndroid Build Coastguard Worker
107*58b9f456SAndroid Build Coastguard Worker //----------------------------------------------------------------------------//
108*58b9f456SAndroid Build Coastguard Worker // BM_Hash
109*58b9f456SAndroid Build Coastguard Worker // ---------------------------------------------------------------------------//
110*58b9f456SAndroid Build Coastguard Worker
111*58b9f456SAndroid Build Coastguard Worker template <class HashFn, class GenInputs>
BM_Hash(benchmark::State & st,HashFn fn,GenInputs gen)112*58b9f456SAndroid Build Coastguard Worker void BM_Hash(benchmark::State& st, HashFn fn, GenInputs gen) {
113*58b9f456SAndroid Build Coastguard Worker auto in = gen(st.range(0));
114*58b9f456SAndroid Build Coastguard Worker const auto end = in.data() + in.size();
115*58b9f456SAndroid Build Coastguard Worker std::size_t last_hash = 0;
116*58b9f456SAndroid Build Coastguard Worker benchmark::DoNotOptimize(&last_hash);
117*58b9f456SAndroid Build Coastguard Worker while (st.KeepRunning()) {
118*58b9f456SAndroid Build Coastguard Worker for (auto it = in.data(); it != end; ++it) {
119*58b9f456SAndroid Build Coastguard Worker benchmark::DoNotOptimize(last_hash += fn(*it));
120*58b9f456SAndroid Build Coastguard Worker }
121*58b9f456SAndroid Build Coastguard Worker benchmark::ClobberMemory();
122*58b9f456SAndroid Build Coastguard Worker }
123*58b9f456SAndroid Build Coastguard Worker }
124*58b9f456SAndroid Build Coastguard Worker
125*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_Hash,
126*58b9f456SAndroid Build Coastguard Worker uint32_random_std_hash,
127*58b9f456SAndroid Build Coastguard Worker std::hash<uint32_t>{},
128*58b9f456SAndroid Build Coastguard Worker getRandomIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
129*58b9f456SAndroid Build Coastguard Worker
130*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_Hash,
131*58b9f456SAndroid Build Coastguard Worker uint32_random_custom_hash,
132*58b9f456SAndroid Build Coastguard Worker UInt32Hash{},
133*58b9f456SAndroid Build Coastguard Worker getRandomIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
134*58b9f456SAndroid Build Coastguard Worker
135*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_Hash,
136*58b9f456SAndroid Build Coastguard Worker uint32_top_std_hash,
137*58b9f456SAndroid Build Coastguard Worker std::hash<uint32_t>{},
138*58b9f456SAndroid Build Coastguard Worker getSortedTopBitsIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
139*58b9f456SAndroid Build Coastguard Worker
140*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_Hash,
141*58b9f456SAndroid Build Coastguard Worker uint32_top_custom_hash,
142*58b9f456SAndroid Build Coastguard Worker UInt32Hash{},
143*58b9f456SAndroid Build Coastguard Worker getSortedTopBitsIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
144*58b9f456SAndroid Build Coastguard Worker
145*58b9f456SAndroid Build Coastguard Worker
146*58b9f456SAndroid Build Coastguard Worker //----------------------------------------------------------------------------//
147*58b9f456SAndroid Build Coastguard Worker // BM_InsertValue
148*58b9f456SAndroid Build Coastguard Worker // ---------------------------------------------------------------------------//
149*58b9f456SAndroid Build Coastguard Worker
150*58b9f456SAndroid Build Coastguard Worker
151*58b9f456SAndroid Build Coastguard Worker // Sorted Assending //
152*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_InsertValue,
153*58b9f456SAndroid Build Coastguard Worker unordered_set_uint32,
154*58b9f456SAndroid Build Coastguard Worker std::unordered_set<uint32_t>{},
155*58b9f456SAndroid Build Coastguard Worker getRandomIntegerInputs<uint32_t>)->Arg(TestNumInputs);
156*58b9f456SAndroid Build Coastguard Worker
157*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_InsertValue,
158*58b9f456SAndroid Build Coastguard Worker unordered_set_uint32_sorted,
159*58b9f456SAndroid Build Coastguard Worker std::unordered_set<uint32_t>{},
160*58b9f456SAndroid Build Coastguard Worker getSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
161*58b9f456SAndroid Build Coastguard Worker
162*58b9f456SAndroid Build Coastguard Worker // Top Bytes //
163*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_InsertValue,
164*58b9f456SAndroid Build Coastguard Worker unordered_set_top_bits_uint32,
165*58b9f456SAndroid Build Coastguard Worker std::unordered_set<uint32_t>{},
166*58b9f456SAndroid Build Coastguard Worker getSortedTopBitsIntegerInputs<uint32_t>)->Arg(TestNumInputs);
167*58b9f456SAndroid Build Coastguard Worker
168*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_InsertValueRehash,
169*58b9f456SAndroid Build Coastguard Worker unordered_set_top_bits_uint32,
170*58b9f456SAndroid Build Coastguard Worker std::unordered_set<uint32_t, UInt32Hash>{},
171*58b9f456SAndroid Build Coastguard Worker getSortedTopBitsIntegerInputs<uint32_t>)->Arg(TestNumInputs);
172*58b9f456SAndroid Build Coastguard Worker
173*58b9f456SAndroid Build Coastguard Worker // String //
174*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_InsertValue,
175*58b9f456SAndroid Build Coastguard Worker unordered_set_string,
176*58b9f456SAndroid Build Coastguard Worker std::unordered_set<std::string>{},
177*58b9f456SAndroid Build Coastguard Worker getRandomStringInputs)->Arg(TestNumInputs);
178*58b9f456SAndroid Build Coastguard Worker
179*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_InsertValueRehash,
180*58b9f456SAndroid Build Coastguard Worker unordered_set_string,
181*58b9f456SAndroid Build Coastguard Worker std::unordered_set<std::string>{},
182*58b9f456SAndroid Build Coastguard Worker getRandomStringInputs)->Arg(TestNumInputs);
183*58b9f456SAndroid Build Coastguard Worker
184*58b9f456SAndroid Build Coastguard Worker //----------------------------------------------------------------------------//
185*58b9f456SAndroid Build Coastguard Worker // BM_Find
186*58b9f456SAndroid Build Coastguard Worker // ---------------------------------------------------------------------------//
187*58b9f456SAndroid Build Coastguard Worker
188*58b9f456SAndroid Build Coastguard Worker // Random //
189*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_Find,
190*58b9f456SAndroid Build Coastguard Worker unordered_set_random_uint64,
191*58b9f456SAndroid Build Coastguard Worker std::unordered_set<uint64_t>{},
192*58b9f456SAndroid Build Coastguard Worker getRandomIntegerInputs<uint64_t>)->Arg(TestNumInputs);
193*58b9f456SAndroid Build Coastguard Worker
194*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_FindRehash,
195*58b9f456SAndroid Build Coastguard Worker unordered_set_random_uint64,
196*58b9f456SAndroid Build Coastguard Worker std::unordered_set<uint64_t, UInt64Hash>{},
197*58b9f456SAndroid Build Coastguard Worker getRandomIntegerInputs<uint64_t>)->Arg(TestNumInputs);
198*58b9f456SAndroid Build Coastguard Worker
199*58b9f456SAndroid Build Coastguard Worker // Sorted //
200*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_Find,
201*58b9f456SAndroid Build Coastguard Worker unordered_set_sorted_uint64,
202*58b9f456SAndroid Build Coastguard Worker std::unordered_set<uint64_t>{},
203*58b9f456SAndroid Build Coastguard Worker getSortedIntegerInputs<uint64_t>)->Arg(TestNumInputs);
204*58b9f456SAndroid Build Coastguard Worker
205*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_FindRehash,
206*58b9f456SAndroid Build Coastguard Worker unordered_set_sorted_uint64,
207*58b9f456SAndroid Build Coastguard Worker std::unordered_set<uint64_t, UInt64Hash>{},
208*58b9f456SAndroid Build Coastguard Worker getSortedIntegerInputs<uint64_t>)->Arg(TestNumInputs);
209*58b9f456SAndroid Build Coastguard Worker
210*58b9f456SAndroid Build Coastguard Worker
211*58b9f456SAndroid Build Coastguard Worker // Sorted //
212*58b9f456SAndroid Build Coastguard Worker #if 1
213*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_Find,
214*58b9f456SAndroid Build Coastguard Worker unordered_set_sorted_uint128,
215*58b9f456SAndroid Build Coastguard Worker std::unordered_set<__uint128_t, UInt128Hash>{},
216*58b9f456SAndroid Build Coastguard Worker getSortedTopBitsIntegerInputs<__uint128_t>)->Arg(TestNumInputs);
217*58b9f456SAndroid Build Coastguard Worker
218*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_FindRehash,
219*58b9f456SAndroid Build Coastguard Worker unordered_set_sorted_uint128,
220*58b9f456SAndroid Build Coastguard Worker std::unordered_set<__uint128_t, UInt128Hash>{},
221*58b9f456SAndroid Build Coastguard Worker getSortedTopBitsIntegerInputs<__uint128_t>)->Arg(TestNumInputs);
222*58b9f456SAndroid Build Coastguard Worker #endif
223*58b9f456SAndroid Build Coastguard Worker
224*58b9f456SAndroid Build Coastguard Worker // Sorted //
225*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_Find,
226*58b9f456SAndroid Build Coastguard Worker unordered_set_sorted_uint32,
227*58b9f456SAndroid Build Coastguard Worker std::unordered_set<uint32_t>{},
228*58b9f456SAndroid Build Coastguard Worker getSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
229*58b9f456SAndroid Build Coastguard Worker
230*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_FindRehash,
231*58b9f456SAndroid Build Coastguard Worker unordered_set_sorted_uint32,
232*58b9f456SAndroid Build Coastguard Worker std::unordered_set<uint32_t, UInt32Hash2>{},
233*58b9f456SAndroid Build Coastguard Worker getSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
234*58b9f456SAndroid Build Coastguard Worker
235*58b9f456SAndroid Build Coastguard Worker // Sorted Ascending //
236*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_Find,
237*58b9f456SAndroid Build Coastguard Worker unordered_set_sorted_large_uint64,
238*58b9f456SAndroid Build Coastguard Worker std::unordered_set<uint64_t>{},
239*58b9f456SAndroid Build Coastguard Worker getSortedLargeIntegerInputs<uint64_t>)->Arg(TestNumInputs);
240*58b9f456SAndroid Build Coastguard Worker
241*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_FindRehash,
242*58b9f456SAndroid Build Coastguard Worker unordered_set_sorted_large_uint64,
243*58b9f456SAndroid Build Coastguard Worker std::unordered_set<uint64_t, UInt64Hash>{},
244*58b9f456SAndroid Build Coastguard Worker getSortedLargeIntegerInputs<uint64_t>)->Arg(TestNumInputs);
245*58b9f456SAndroid Build Coastguard Worker
246*58b9f456SAndroid Build Coastguard Worker
247*58b9f456SAndroid Build Coastguard Worker // Top Bits //
248*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_Find,
249*58b9f456SAndroid Build Coastguard Worker unordered_set_top_bits_uint64,
250*58b9f456SAndroid Build Coastguard Worker std::unordered_set<uint64_t>{},
251*58b9f456SAndroid Build Coastguard Worker getSortedTopBitsIntegerInputs<uint64_t>)->Arg(TestNumInputs);
252*58b9f456SAndroid Build Coastguard Worker
253*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_FindRehash,
254*58b9f456SAndroid Build Coastguard Worker unordered_set_top_bits_uint64,
255*58b9f456SAndroid Build Coastguard Worker std::unordered_set<uint64_t, UInt64Hash>{},
256*58b9f456SAndroid Build Coastguard Worker getSortedTopBitsIntegerInputs<uint64_t>)->Arg(TestNumInputs);
257*58b9f456SAndroid Build Coastguard Worker
258*58b9f456SAndroid Build Coastguard Worker // String //
259*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_Find,
260*58b9f456SAndroid Build Coastguard Worker unordered_set_string,
261*58b9f456SAndroid Build Coastguard Worker std::unordered_set<std::string>{},
262*58b9f456SAndroid Build Coastguard Worker getRandomStringInputs)->Arg(TestNumInputs);
263*58b9f456SAndroid Build Coastguard Worker
264*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_FindRehash,
265*58b9f456SAndroid Build Coastguard Worker unordered_set_string,
266*58b9f456SAndroid Build Coastguard Worker std::unordered_set<std::string>{},
267*58b9f456SAndroid Build Coastguard Worker getRandomStringInputs)->Arg(TestNumInputs);
268*58b9f456SAndroid Build Coastguard Worker
269*58b9f456SAndroid Build Coastguard Worker ///////////////////////////////////////////////////////////////////////////////
270*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_InsertDuplicate,
271*58b9f456SAndroid Build Coastguard Worker unordered_set_int,
272*58b9f456SAndroid Build Coastguard Worker std::unordered_set<int>{},
273*58b9f456SAndroid Build Coastguard Worker getRandomIntegerInputs<int>)->Arg(TestNumInputs);
274*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_InsertDuplicate,
275*58b9f456SAndroid Build Coastguard Worker unordered_set_string,
276*58b9f456SAndroid Build Coastguard Worker std::unordered_set<std::string>{},
277*58b9f456SAndroid Build Coastguard Worker getRandomStringInputs)->Arg(TestNumInputs);
278*58b9f456SAndroid Build Coastguard Worker
279*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
280*58b9f456SAndroid Build Coastguard Worker unordered_set_int,
281*58b9f456SAndroid Build Coastguard Worker std::unordered_set<int>{},
282*58b9f456SAndroid Build Coastguard Worker getRandomIntegerInputs<int>)->Arg(TestNumInputs);
283*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
284*58b9f456SAndroid Build Coastguard Worker unordered_set_string,
285*58b9f456SAndroid Build Coastguard Worker std::unordered_set<std::string>{},
286*58b9f456SAndroid Build Coastguard Worker getRandomStringInputs)->Arg(TestNumInputs);
287*58b9f456SAndroid Build Coastguard Worker
288*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_InsertDuplicate,
289*58b9f456SAndroid Build Coastguard Worker unordered_set_int_insert_arg,
290*58b9f456SAndroid Build Coastguard Worker std::unordered_set<int>{},
291*58b9f456SAndroid Build Coastguard Worker getRandomIntegerInputs<int>)->Arg(TestNumInputs);
292*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_InsertDuplicate,
293*58b9f456SAndroid Build Coastguard Worker unordered_set_string_insert_arg,
294*58b9f456SAndroid Build Coastguard Worker std::unordered_set<std::string>{},
295*58b9f456SAndroid Build Coastguard Worker getRandomStringInputs)->Arg(TestNumInputs);
296*58b9f456SAndroid Build Coastguard Worker
297*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
298*58b9f456SAndroid Build Coastguard Worker unordered_set_int_insert_arg,
299*58b9f456SAndroid Build Coastguard Worker std::unordered_set<int>{},
300*58b9f456SAndroid Build Coastguard Worker getRandomIntegerInputs<unsigned>)->Arg(TestNumInputs);
301*58b9f456SAndroid Build Coastguard Worker
302*58b9f456SAndroid Build Coastguard Worker BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
303*58b9f456SAndroid Build Coastguard Worker unordered_set_string_arg,
304*58b9f456SAndroid Build Coastguard Worker std::unordered_set<std::string>{},
305*58b9f456SAndroid Build Coastguard Worker getRandomCStringInputs)->Arg(TestNumInputs);
306*58b9f456SAndroid Build Coastguard Worker
307*58b9f456SAndroid Build Coastguard Worker BENCHMARK_MAIN();
308