Golang Maps: how Swiss Tables replaced the old bucket design

(blog.gaborkoos.com)

25 points | by Terretta 3 days ago

2 comments

  • christophilus 48 minutes ago
    Reads like GPT. But, it was still interesting to me. I hadn’t heard of Swiss tables before. The article links to the primary sources, to those who want to avoid reading LLM output: https://abseil.io/about/design/swisstables
    • tialaramex 22 minutes ago
      The Swiss Table is Google's preferred hash table design, it's what you get in the Abseil C++ library and for many years it is the implementation behind Rust's HashMap type too, and as you see, it's also now how Go's map works.

      https://www.youtube.com/watch?v=JZE3_0qvrMg is the 2019 CppCon talk by Matt Kulukundis which gets into more depth of why this is a good idea if you're the sort of person who knows what SIMD is and how caches work.

    • Beretta_Vexee 40 minutes ago
      This is one of the least clear explanations of what a hash map bucket and overflow are that I hav read.
      • lalitmaganti 37 minutes ago
        Have to plug the original Swiss Table talk by Matt Kulukundis: https://youtu.be/ncHmEUmJZf4?si=YRl2pDvdGZgd2ROq

        Excellent talk which explains the concepts really clearly and concisely.

      • denotational 31 minutes ago
        The OP, or the Abseil docs?
        • Beretta_Vexee 15 minutes ago
          gaborkoos.com blog post, It suggests that the overflow is a sort of extension of the primary bucket, when it is a entry par entry collisions resolution mechanism.

          The abseil documentation is dense but clear. It’s a sort of SSE optimized upside down Merkle tree.

  • hbcdbff 22 minutes ago
    Slop

    LLMs write so badly