C++Now 2018: You Can Do Better than std::unordered_map: New Improvements to Hash Table Performance
CppNow2 HN recommenders · recommended in 2 months, 2021-2024
63K views · 8 years ago · talk · evergreen
Malte Skarupke's C++Now 2018 talk on hash table performance, explaining why std::unordered_map is slow and memory hungry and presenting faster designs, including his bytell hash map.
Recommended as a thorough, well-regarded explanation of hash table design tradeoffs and why the standard container is a poor choice.
1:13:41CppCon 2014: Chandler Carruth "Efficiency with Algorithms, Performance with Data Structures"
CppCon
235K views • 12 years ago
59:34CppCon 2017: Matt Kulukundis “Designing a Fast, Efficient, Cache-friendly Hash Table, Step by Step”
CppCon
137K views • 9 years ago
54:01Abseil's Open Source Hashtables: 2 Years In - Matt Kulukundis - CppCon 2019
CppCon
22K views • 7 years ago
58:36Advanced Topics in Programming Languages: A Lock-Free Hash Table
GoogleTalksArchive
29K views • 14 years ago
31:19CppCon 2016: Nicholas Ormrod “The strange details of std::string at Facebook"
CppCon
122K views • 10 years ago
55:49CppCon 2016: Chandler Carruth “High Performance Code 201: Hybrid Data Structures"
CppCon
119K views • 10 years ago
1:54:00Can C++ be 10x Simpler & Safer? - Herb Sutter - CppCon 2022
CppCon
277K views • 3 years ago
1:04:00CppCon 2015: Sean Parent "Better Code: Data Structures"
CppCon
106K views • 11 years ago
1:29:55Sorting Algorithms: Speed Is Found In The Minds of People - Andrei Alexandrescu - CppCon 2019
CppCon
184K views • 7 years ago
1:17:12C++ Seasoning
aghuttun
58K views • 13 years ago
52:54Rust at speed — building a fast concurrent database
Jon Gjengset
225K views • 7 years ago
1:33:022013 Keynote: Chandler Carruth: Optimizing the Emergent Structures of C++
CppNow
34K views • 13 years ago
1:00:17Stephan T. Lavavej “Floating-Point <charconv>: Making Your Code 10x Faster With C++17's Final Boss”
CppCon
41K views • 7 years ago
1:27:46CppCon 2014: Mike Acton "Data-Oriented Design and C++"
CppCon
862K views • 12 years ago
1:39:25CppCon 2016: Herb Sutter “Leak-Freedom in C++... By Default.”
CppCon
149K views • 10 years ago
30:37High-performance Tree Wrangling, the APL Way // Aaron Hsu // Dyalog '18
Dyalog User Meetings
6K views • 7 years ago
40:18"Compacting the Uncompactable" by Bobby Powers
Strange Loop Conference
29K views • 7 years ago
1:04:26CppCon 2018: G. Nishanov “Nano-coroutines to the Rescue! (Using Coroutines TS, of Course)”
CppCon
40K views • 8 years ago
1:21:13C++ and Beyond 2012: Herb Sutter - atomic Weapons 1 of 2
alexsmail
71K views • 9 years ago
34:55"Outperforming Imperative with Pure Functional Languages" by Richard Feldman
Strange Loop Conference
98K views • 5 years ago
4 comments from Hacker News
Many videos on hash table are great. I found this one particularly good. [ ▶ this video ] C++Now 2018: You Can Do Better than std::unordered_map: New Improvements to Hash Table Performance
In my example the table stores the hash codes themselves instead of the keys (because the hash function is invertible) Oh, I see, right. If determining the home bucket is trivial, then the back-shifting method is great. The issue is just that it’s not as much of a general-purpose solution as it may initially seem. In the bad cases, it's really bad. With a different algorithm (Robin Hood or bidirectional linear probing), the load factor can be kept well over 90% with good performance, as the benchmarks in the same repo demonstrate. I’ve seen the 90% claim made several times in literature on Robin Hood hash tables. In my experience, the claim is a bit exaggerated, although I suppose it depends on what our idea of “good performance” is. See these benchmarks, which again go up to a maximum load factor of 0.95 (although boost and Absl forcibly grow/rehash at 0.85-0.9): link Tsl, Martinus, and CC are all Robin Hood tables ( link , link , and link , respectively). Absl (from Google) and Boost are well-known C++ SIMD-based hash tables. Khash ( link ) is, I think, an ordinary open-addressing table using quadratic probing. Fastmap is a new, yet-to-be-published design that is fundamentally similar to bytell ( ▶ this video ) but also incorporates some aspects of the aforementioned SIMD maps (in particular, it stores a 4-bit fragment of the hash code to avoid most false key comparisons). As you can see, all the Robin Hood maps spike upwards dramatically as the load factor gets high,
It has the right asymptotic guarantees for a hash map, but beyond that it doesn't have much going for it. The degree to which it emphasizes pointer/iterator stability and arbitrary load factors is not a good tradeoff in almost any practical case (unless you do not care about performance). See ▶ this video for a more comprehensive discussion, or the sibling threads here.
> some kind of bucket-optimisation (multiple elements per allocation, instead of one element per allocation) should also meet all constraints the standard sets for this type Pretty sure that makes it impossible to implement merge without pointer/iterator invalidation, which is a constraint imposed by the standard ( link ). > it would be good if the person I originally responded to came out and defended his POV See link if you want numbers, or for example this talk by the same author ▶ this video .