Skip to content

Commit d6ce39d

Browse files
ezbrcopybara-github
authored andcommitted
Use 16 bits of per-table-seed so that we can save an and instruction in H1.
PiperOrigin-RevId: 741585710 Change-Id: Id3aac35ad71083c015a57593b094706d5b91bbf4
1 parent f9ea7cf commit d6ce39d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

absl/container/internal/raw_hash_set.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,9 @@ class PerTableSeed {
451451
// The number of bits in the seed.
452452
// It is big enough to ensure non-determinism of iteration order.
453453
// We store the seed inside a uint64_t together with size and other metadata.
454-
static constexpr size_t kBitCount = 19;
454+
// Using 16 bits allows us to save one `and` instruction in H1 (we use movzwl
455+
// instead of movq+and).
456+
static constexpr size_t kBitCount = 16;
455457

456458
// Returns the seed for the table. Only the lowest kBitCount are non zero.
457459
size_t seed() const { return seed_; }

0 commit comments

Comments
 (0)