Go 1.24 rebuilds built-in maps using Swiss Tables data structure
A technical deep-dive explains how Go 1.24 replaced its previous map runtime implementation with one based on Swiss Tables, a hashing design originally popularized by Google. The article breaks down the internal Map struct, showing how fields like 'used' let operations such as len(m) run in constant time, and how copying a map variable simply copies a pointer to shared underlying storage.
GoKawiil's interpretation of the reporting above, not reported fact.
Maps are among the most heavily used data structures in Go programs, so changes to their internal implementation can affect performance and memory behavior across countless applications without requiring any code changes from developers. Understanding these internals also helps engineers reason correctly about map semantics, like why copying a map doesn't duplicate its data.
- Go 1.24 replaced the old map runtime with a Swiss Tables-based design.
- The Map struct stores metadata like an entry counter directly, making len(m) an O(1) operation.
- Copying a map variable copies only a pointer, so all copies reference the same underlying entries.
Learning Go by Jon Bodner (O'Reilly) — If this deep dive into Go's Swiss Table map internals hooked you, Jon Bodner's Learning Go is the natural companion for building idiomatic Go from the ground up. It covers maps, slices, interfaces and concurrency with the same practical, example-driven style, making it a great desk reference while you explore the runtime.
See Learning Go by Jon Bodner (O'Reilly) on Amazon → Affiliate link — we may earn a commission on purchases, at no extra cost to you. Product picked by AI based on this article; it is not a tested recommendation.Source: victoriametrics.com, 2026-09-03
Published there as: “How Swiss tables work in Go built-in map”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.