We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fcb9a89 commit 60c4e72Copy full SHA for 60c4e72
fleetbench/swissmap/swissmap_benchmark.h
@@ -356,11 +356,12 @@ class alignas(kSize < 8 ? 4 : 8) Value : private Ballast<kSize - 4> {
356
uint32_t value_;
357
};
358
359
-// Use a zero cost hash function. The purpose of this benchmark is to focus on
+// Use a low cost hash function. The purpose of this benchmark is to focus on
360
// the implementations of the containers, not the quality or speed of their hash
361
-// functions.
+// functions. We can't use identity hash function with random 32-bit keys
362
+// because then the high bits of the hashes would be always 0.
363
struct Hash {
- size_t operator()(size_t x) const { return x; }
364
+ size_t operator()(size_t x) const { return x ^ (x << 32); }
365
366
367
struct Eq {
0 commit comments