-
Every few months somebody asks me which C++ hashmap is the fastest, and the honest answer is that the question is malformed. There is no fastest one. There is a fastest one for what your code does, and the same container can be the best and the worst choice on the same machine depending on whether you iterate. [Read More]
-
Four Buckets at a Time
How ankerl::unordered_dense got 1.6x faster lookups with SSE2, explained for people who have never written an intrinsic
ankerl::unordered_dense is my C++ hash map. It has been stable for years, and this summer it got the most performance work since I wrote it. Random lookups with integer keys run 1.6x faster than they did in January, insert and erase 1.25x, and the string find, insert, build and churn workloads gained 14 to 17%. Most of that comes from one idea: the probe now reads four buckets at once with SSE2 instead of one at a time, and the insert and erase paths do the same with their shifting. [Read More] -
A Haircut After a Year
A roof, a haircut, and a birthday.
The last few days were quite busy for me. I finished the roof of our small garden house which my wife and I built for the kids. They are 4 and 8 years old and finally have a small house they can play in right next to their sandbox. They love it. I also cleaned up the garage, I had my 47th birthday, and I was at the barber for the first time after about a year. [Read More] -
A Broken Build Is Not a Bad Commit
I chased a regression through two months of history where half the commits wouldn't even compile. Here's the tool I wrote so it wouldn't happen again.
A few weeks ago I hit the kind of bug that ruins an afternoon: something that used to work didn’t anymore, and I had no idea when it broke. Not “yesterday”, not “in that one PR” — somewhere in the last month or two, buried in a stretch of history where the build had also been getting torn up. This is a shared project with a lot of people committing to it, and in that same window a broken third-party dependency had been swapped for a newer version, a compiler had moved, and a pile of little fixes had gone... [Read More] -
The Web Catastrophe That Kept Refusing to Happen
I tried three times to prove my old site was a disaster. I lost every time, with data.
Back in 2012 I made a keto calculator because I wanted exact macro numbers for my own diet, and all the advice online was too vague. I posted it on /r/keto, people liked it, Google ranked it well, and for years it quietly earned ad money while I worked on other things. It’s a single static HTML page. No backend, no build step, no database. A site like that should basically run forever. [Read More] -
Comprehensive C++ Hashmap Benchmarks 2022
Where I've spent way too much time creating benchmarks of C++ hashmaps
It’s been over 3 years since I’ve spent considerable time finding the best C++ hashmap. After several requests I finally gave in and redid the benchmark with state of C++ hashmaps as of August 2022. This took much more work than I initially anticipated, mostly due to the fact that benchmarks take a looong time, and writing everything up and creating a representation that is actually useful takes even more time. Thanks everyone who annoyingly kept asking me for updates
[Read More]
-
Kindle Paperwhite Tips
Some helpful Tricks
I recently upgraded from my 8 year old Kindle Keyboard (2011) to a brand new Kindle Paperwhite (2019, generation 10). So far, it is a great upgrade. Here are some tricks that I found useful: [Read More] -
Hashmaps Benchmarks - Conclusion
Finding the Fastest, Memory Efficient Hashmap
Table of Contents [Read More] -
Hashmaps Benchmarks - Iterating
Finding the Fastest, Memory Efficient Hashmap
Table of Contents [Read More] -
Hashmaps Benchmarks - Find 1 -- 1M std::string
Finding the Fastest, Memory Efficient Hashmap
Table of Contents [Read More] -
Hashmaps Benchmarks - Find 1 -- 100k std::string
Finding the Fastest, Memory Efficient Hashmap
Table of Contents [Read More] -
Hashmaps Benchmarks - Find 1 -- 500k uint64_t
Finding the Fastest, Memory Efficient Hashmap
Table of Contents [Read More] -
Hashmaps Benchmarks - Find 1 -- 2000 uint64_t
Finding the Fastest, Memory Efficient Hashmap
Table of Contents [Read More] -
Hashmaps Benchmarks - Insert & Erase std::string
Finding the Fastest, Memory Efficient Hashmap
Table of Contents [Read More] -
Hashmaps Benchmarks - Insert & Erase uint64_t
Finding the Fastest, Memory Efficient Hashmap
Table of Contents [Read More] -
Hashmaps Benchmarks - Insert & Access with Varying Probability int
Finding the Fastest, Memory Efficient Hashmap
Table of Contents [Read More] -
Hashmaps Benchmarks - Insert & Erase 100M int
Finding the Fastest, Memory Efficient Hashmap
Table of Contents [Read More] -
Hashmaps Benchmarks - Construction & Insert 1 int & Destruction
Finding the Fastest, Memory Efficient Hashmap
Table of Contents [Read More] -
Hashmaps Benchmarks - Construction & Destruction
Finding the Fastest, Memory Efficient Hashmap
Table of Contents [Read More] -
Hashmaps Benchmarks - Overview
Finding the Fastest, Memory Efficient Hashmap
Table of Contents [Read More]