From d94b7a187685942579e7d7dc00bf58448cdafce8 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 7 Aug 2024 13:02:43 -0400 Subject: cmd/compile,internal/runtime/maps: add extendible hashing Extendible hashing splits a swisstable map into many swisstables. This keeps grow operations small. For #54766. Cq-Include-Trybots: luci.golang.try:gotip-linux-ppc64_power10,gotip-linux-amd64-longtest-swissmap Change-Id: Id91f34af9e686bf35eb8882ee479956ece89e821 Reviewed-on: https://go-review.googlesource.com/c/go/+/604936 Reviewed-by: Keith Randall LUCI-TryBot-Result: Go LUCI Reviewed-by: Keith Randall --- src/internal/runtime/maps/table_debug.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/internal/runtime/maps/table_debug.go') diff --git a/src/internal/runtime/maps/table_debug.go b/src/internal/runtime/maps/table_debug.go index b800858e55..2478b02bab 100644 --- a/src/internal/runtime/maps/table_debug.go +++ b/src/internal/runtime/maps/table_debug.go @@ -19,9 +19,9 @@ func (t *table) checkInvariants() { // For every non-empty slot, verify we can retrieve the key using Get. // Count the number of used and deleted slots. - var used uint64 - var deleted uint64 - var empty uint64 + var used uint16 + var deleted uint16 + var empty uint16 for i := uint64(0); i <= t.groups.lengthMask; i++ { g := t.groups.group(i) for j := uint32(0); j < abi.SwissMapGroupSlots; j++ { @@ -82,6 +82,8 @@ func (t *table) checkInvariants() { func (t *table) Print() { print(`table{ seed: `, t.seed, ` + index: `, t.index, ` + localDepth: `, t.localDepth, ` capacity: `, t.capacity, ` used: `, t.used, ` growthLeft: `, t.growthLeft, ` -- cgit v1.3-5-g9baa