docs: 更新 Go 1.24 后 map 的哈希表实现说明
作者: Gzx-070829创建于 2026年8月14日更新于 2026年8月14日
Problem Description In "6.2 Hash Collisions → 6.2.3 Programming Language Selection", the current description of Go's map is as follows: "Go uses chaining addresses. Go specifies that each bucket can store up to 8 key-value pairs, and when the capacity is exceeded, an overflow bucket is connected. When the number of overflow buckets is too large, a special equal-size expansion operation is performed to ensure performance." This description corresponds to the map implementation in Go 1.23 and earlier versions. Starting with Go 1.24, Go has switched the built-in map to a new implementation based on Swiss Table. Swiss Table is an open addressing hash table. The Go official blog: Faster Go maps with Swiss Tables The internal/runtime/maps/map.go in the current Go runtime source code also states: "The map design is based on Abseil's Swiss Table design. The core structure is similar to an open addressing hash table."
内容来源: krahets/hello-algo