{
  "id": 5310758,
  "title": "How Swiss Tables Work in Go’s Built-in Map",
  "url": "https://urgent.news/2026/09/03/how-swiss-tables-work-in-gos-built-in-map",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-03T10:50:44.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://victoriametrics.com/blog/go-swiss-table-map/"
  },
  "original_language": "en",
  "account": "Go versions 1.24 and later have replaced the old map implementation with a new design based on Swiss Tables. To understand this change, we need to first review how Go maps work and the key concepts involved. A map stores key-value pairs, where each key is associated with a single value. The key and value types can be different, and maps are created using the make function, providing a sizing hint to the runtime. For example, make(map[string]int, 100) requests initial storage for around 100 entries, but the actual capacity is 128 slots, allowing for 112 entries before the map needs to grow. Maps can hold zero or more entries, with the zero value of a map being nil. The len function returns the number of stored entries, while cap is not applicable to maps. The assignment, lookup, and deletion operations are consistent across all versions of Go. When looking up a value with value := m[\"dog\"], the operation returns the value directly if \"dog\" is present, or the zero value of the value type (0 for int) if \"dog\" is missing. The two-value form value, ok := m[\"dog\"] provides additional information by returning a boolean ok, indicating whether the map contains \"dog\". This helps differentiate between a missing key and a stored key with the value 0. The map's key type must be comparable, as Go hashes each key to locate candidate slots and then compares candidate keys for equality using the == operator. This requirement ensures that the map can accurately locate and verify the presence of keys.",
  "summary": null,
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}