HackerTube

CppCon 2017: Matt Kulukundis “Designing a Fast, Efficient, Cache-friendly Hash Table, Step by Step”

CppCon9 HN recommenders · recommended in 10 months, 2018–2026
YouTube
talk · advanced · evergreen · 2018–2026 on HN

Matt Kulukundis explains how Google designed SwissTable, a fast, cache-friendly hash table, step by step from std::unordered_map. The talk covers open addressing, SIMD probing and the tradeoffs of changing a fundamental data structure.

HN repeatedly cites it as the definitive explanation of SwissTable, the design behind Abseil, Rust's hash map and Go's maps.

12 comments from Hacker News

@lalitmaganti2026-07 · in “Golang Maps: how Swiss Tables replaced the old bucket design”

Have to plug the original Swiss Table talk by Matt Kulukundis: ▶ this video Excellent talk which explains the concepts really clearly and concisely.

Strongly recommends View on HN
@KerrickStaley2022-11 · in “Inside boost::unordered_flat_map”

Related: this talk ▶ this video about the making of absl::flat_hash_map (a "competitor" to boost::unordered_flat_map) is one of my favorites.

Strongly recommends View on HN
@sujayakar2021-03 · in “MIPS Becomes RISC-V”

Very cool! Independent of the cool use of `aesenc` and `aesdec`, the features for skipping ahead in the random stream and forking a separate stream are awesome. > My current home project is bump-allocator + semi-space garbage collection in SIMD for GPUs. As far as I can tell, both bump-allocation and semi-space garbage collection are easily SIMDified in an obvious manner. And since cudamalloc is fully synchronous, I wanted a more scalable, parallel solution to the GPU memory allocation problem. This is a great idea. I wonder if we could speed up LuaJIT even more by SIMD accelerating the GC's mark and/or sweep phases... If you're interested in more work in this area, a former coworker wrote a neat SPMD implementation of librsync [1]. And, if you haven't seen it, the talk on SwissTable [2] (Google's SIMD accelerated hash table) is excellent. [1] link [2] ▶ this video

Strongly recommends View on HN
@nwallin2019-10 · in “Hash tables”

I think you're underestimating the number of memory redirections that are necessary for chaining. It's more than one. That's the killer. It's important to be wary of assuming your data will be in cache. It usually isn't. The problem isn't making lots of high density searches in a hash map, the problem is making a search every now and then. A hash map that makes three DRAM accesses will always be worse that one that makes one, regardless of how much work it needs to do, and this is for two reasons. First is there obvious: RAM is slow as balls, we get it. Second is more insidious. You just evicted two cache lines. It's not just the lookup itself that's slower, you also made the consumer of your data structure slower. Here's a look at what open addressing looks like these days: ▶ this video (warning, it's an hour. Takes a while to build up, too. Still worth it.)

Strongly recommends View on HN
@SkiFire132025-07 · in “How we tracked down a Go 1.24 memory regression”

In addition to this comment's siblings resources, I also suggest this really good Cppcon presentation on Swisstable ▶ this video

Recommends View on HN