Top all-time · #2777
Martin Leitner-Ankerl
Personal blog · martin.ankerl.comprogrammingsystems
Martin Leitner-Ankerl's personal blog at martin.ankerl.com covers programming and systems. Since 2007, 28 different Hacker News readers have linked it 36 times, most often “Comprehensive C++ Hashmap Benchmarks 2022”. It is still writing: the last post was on 2026-10-01, and you can follow it by feed.
Too few sampled comments (18) to say how often HN recommends it.?
Why HN links it
HN readers link Martin Leitner-Ankerl's posts as sources on C++ hash map benchmarks and on generating distinguishable colour palettes with the golden ratio. One commenter also endorses a compact GNOME theme post.
Summarised by Claude from a sample of 18 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Programming, Nutrition, Health, Bitcoin, ...
Most-linked posts?
- Comprehensive C++ Hashmap Benchmarks 20228 people · 8 mentions · first linked 2022-09-07
- Hashmaps Benchmarks – Finding the Fastest, Memory Efficient Hashmap6 people · 7 mentions · first linked 2019-07-29
- How to Generate Random Colors Programmatically3 people · 3 mentions · first linked 2009-12-11
- How to Generate Random Colors Programmatically3 people · 3 mentions · first linked 2018-05-10
- Optimized pow() approximation for Java, C / C++, and C#2 people · 2 mentions · first linked 2007-12-28
What Hacker News says?
I've used the method described here [0] of simply incrementing hue by the golden ratio. You can generate dozens of colors that go well together yet are quite distinguishable. [0] https://martin.ankerl.com/2009/12/09/how-to-create-random-co...
Comment linking /2009/12/09/how-to-create-random-colors-programmatically/
on “ColorBox by Lyft Design”Submitted Comprehensive C++ Hashmap Benchmarks 2022 as a story · 9 points
HN discussionIt looks like caching definitely skewed the results a bit. You can take a look at the linked code yourself. Worst case was still only around 80 nanoseconds which is definitely slower, but still orders of magnitude faster than "sub 5 micros". Don't take my word for it though, you can take a look at the Robin Hood benchmarks[0]. Robin Hood unordered map is a competitive hash map that's performed much better than the S…
Comment linking /2019/04/01/hashmap-benchmarks-04-03-result-RandomFind_500000/
on “Don’t call it a comeback: Java is still champ”Submitted How to Generate Random Colors Programmatically as a story · 6 points
HN discussionNo, the author simply repeated old stuff. If all those 'reasonable' diets worked, the current obesity epidemic would not be in its worst point, as it is. Some evidence about sugar: http://www.youtube.com/watch?v=dBnniua6-oM http://www.youtube.com/watch?v=PRAwgdvhWHw http://martin.ankerl.com/wp-content/uploads/2012/01/trouble_...
Comment linking /wp-content/uploads/2012/01/trouble_with_fructose_slides.pdf
on “Actually eat healthily for £1 per day”Submitted Optimized pow() approximation for Java, C / C++, and C# as a story · 5 points
HN discussionThe absl tables (the canonical Swisstables) are good, but not the fastest. Of course, everything will depend on your hardware, compiler and usage patterns, but if you look at an all-round benchmark like https://martin.ankerl.com/2022/08/27/hashmap-bench-01/ , they're about in the middle of the pack even when picking the best-working hash functions (and really bad if you happen to have a bad one). This mirrors my own…
Comment linking /2022/08/27/hashmap-bench-01/
on “SIMD within a register: How I doubled hash table lookup performance”Submitted Comprehensive C++ Hashmap Benchmarks 2022 as a story · 3 points
HN discussionstd::map is incredibly slow (and allocates willy-nilly), see https://martin.ankerl.com/2019/04/01/hashmap-benchmarks-01-o... for a comparison of modern hash maps. Or at least boost::flat_map if you need ordering but don't do many insertions / removals and care instead for fast iteration on the map. Note: when I say "incredibly slow", it is relative to what is possible to achieve in C++ - it will still roll over many…
Comment linking /2019/04/01/hashmap-benchmarks-01-overview/
on “Comparisons in C++20”Submitted Hashmaps Benchmarks – Insert and Erase 100M integers as a story · 3 points
HN discussionRelated : "How to Generate Random Colors Programmatically" http://martin.ankerl.com/2009/12/09/how-to-create-random-col...
Comment linking /2009/12/09/how-to-create-random-colors-programmatically/
on “RandomColor – a color generator for JavaScript”Submitted Hashmaps Benchmarks – Finding the Fastest, Memory Efficient Hashmap as a story · 3 points
HN discussionthat's absolutely untrue in a lot of cases: https://stackoverflow.com/questions/36392583/is-an-unordered... of course one can always find faster, drop-in replacement libraries: https://martin.ankerl.com/2019/04/01/hashmap-benchmarks-01-o... e.g. replacing std::unordered_map with robin_hood::hash_map makes the above C++ code go from 1.2 seconds to 0.5 seconds on my machine (std::map is around 1.3/1.4 seconds for libs…
Comment linking /2019/04/01/hashmap-benchmarks-01-overview/
on “A Tale of Java Hash Tables”Submitted Which C++ hash map should you use? as a story · 2 points
HN discussionHashmaps Benchmarks: https://martin.ankerl.com/2019/04/01/hashmap-benchmarks-05-c...
Comment linking /2019/04/01/hashmap-benchmarks-05-conclusion/
on “Comparison of C++17, Go, and Java for a next-generation sequencing tool”Submitted Comprehensive C++ Hashmap Benchmarks (2022) as a story · 2 points
HN discussionTo anybody unfamiliar with recent progress, boost::unordered_flat_map is the fastest open-addressing hash map implementation in this field for C++. Coming out just several months ago, it outperforms absl::flat_hash_map and various other implementations benchmarked in https://martin.ankerl.com/2022/08/27/hashmap-bench-01/ .
Comment linking /2022/08/27/hashmap-bench-01/
on “Inside boost::unordered_flat_map”Submitted C++ Hashmaps Benchmarks as a story · 2 points
HN discussionI don't see how you can blame terminal applications - they typically have been able to dump around 1Mb of output per second for decades. https://martin.ankerl.com/2007/09/01/comprehensive-linux-ter... Could the React rendering stack be optimised instead?
Comment linking /2007/09/01/comprehensive-linux-terminal-performance-comparison/
on “Claude Code Is Being Dumbed Down”Submitted Hashmaps Benchmarks – Overview Finding the Fastest, Memory Efficient Hashmap as a story · 2 points
HN discussionFor arbitrarily many colors, use the golden ratio: http://martin.ankerl.com/2009/12/09/how-to-create-random-col...
Comment linking /2009/12/09/how-to-create-random-colors-programmatically/
on “Show HN: A Color Palette Generator I Built For My Senior Thesis”Submitted How to Generate Random Colors Programmatically as a story · 2 points
HN discussionThis is something that is an absolute must if you're like me and hate the current huge button/label/tab/* trend in UIs. http://martin.ankerl.com/2008/05/13/human-compact-gnome-them... It just makes the default Human and Clearlooks themes much more compact, so its a good way to get more screen space without going all XMonad-crazy ;) Edit: Also, the "Esco" and "Metabox" window borders are good companions to this, as t…
Comment linking /2008/05/13/human-compact-gnome-theme/
on “New Ubuntu is out”Submitted Optimized pow() approximation for Java and C / C++ as a story · 2 points
HN discussion> As you have a budget of 6ms per frame for 165 FPS, and you often need to iterate over many thousands of entities in each frame, std::unordered_map for one is a non-starter. that's when you use one of the two hundred alternative implementations which keeps the same API but offer different performance compromises & tradeoffs : https://martin.ankerl.com/2019/04/01/hashmap-benchmarks-02-0... If you prototyped with std…
Comment linking /2019/04/01/hashmap-benchmarks-02-01-result-CtorDtorEmptyMap/
on “Orthodox C++”Submitted The Index Structures of Fast C++ Hash Maps as a story · 1 points
HN discussionMy understanding of the word "quick" in the title is that this code is quick to write. But then this brings up the question of why. Why do we prioritize code that is easy to write, which presumably means it needs to be written over and over again. Is this a reflection of the sad state of C library packaging? A quick perusal of the hashmap landscape[0] in C++ shows a vibrant ecosystem where newer and faster implement…
Comment linking /2022/08/27/hashmap-bench-01/
on “Examples of quick hash tables and dynamic arrays in C”Submitted Comprehensive C++ Hashmap Benchmarks 2022 as a story · 1 points
HN discussionUbuntu/Gnome user here: You know, I really love the idea of KDE, their philosophy and recent developments and progress they've made... but I've tried KDE 4.1 and I can't make myself use it. Its superficial but I think its their visual style that I find somewhat off-putting. I wish I had the time/drive and visual design skills to build a complete KDE 4.x theme, something far visually smaller, simpler and more minimal…
Comment linking /2007/11/04/clearlooks-compact-gnome-theme/
on “KDE 4.2.0 Release Announcement”Submitted How to Generate Random Colors Programmatically (2009) as a story · 1 points
HN discussion