HN Hall of Fame Weekly email

B-Heap vs. Binary Heap (2010)

queue.acm.org Essays & writing Essays & articles Software engineering Candidate

Resurfaced independently across 10 calendar years, with breakout response in 2 of them.

submissions
11
submitters
11
observed span
2010–2025
peak thread · 56 comments
273 pts
latest 20+ return · 2018-03-18
238 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

Knuth was writing for MIX. This machine, like all its contemporaries, had a flat memory hierarchy. If you've ever wondered why the CS literature seems full of trees, but in 2010 practice, sets, associative memories, etc., are often implemented with hashing, consider that a cache miss on much modern hardware is 300 cycles. The equivalent of for (register int i = 0; i < 299; i++) ; can pay for itself by saving a cache miss. The log N cache…

kmavm·273-point thread·

A great reminder that spatial locality can be critical to performance. But that's actually quite well-known, and maybe a more important lesson would be: don't take performance for granted, even in standard libraries of well stablished languages or algorithms, there might be much room for improvement for your use case (if you need it). This said, the article feels quite arrogant. As other commenters say, the idea behind the optimization is nothing new, just some basic concepts well applied. Which…

slx26·238-point thread·

This is a great article and the diagrams illustrating the difference between a binary heap and a B-heap are awesome. The comments are amusingly negative, too. It's worth noting that it was published in 2010, though. The Wikipedia article on B-heaps actually references this article: http://en.wikipedia.org/wiki/B-heap

jfarmer·99-point thread·

Summary: A common way to store a binary heap is so that the children of n are located at {2n, 2n+1}. This has the effect that parent and child are usually located in different memory pages if the tree is big. Traversing the tree is faster if it's stored so that each page contains a small subtree that is a few levels deep. So we go from [1] to [2] where the white boxes are memory pages and the numbers…

robalni·3-point thread·

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
2

100+ points or 50+ comments

Total points
628

reference only — not used in Hall rules or ranking

Total comments
113

reference only — not used in Hall rules or ranking

Every submission

DateTitle as submittedByPointsComments
2010-06-12You're Doing It Wrong: CS in the real worldFirst breakout · Best threadfragmede27356
2013-04-21B-Heap vs. Binary Heap (2010)sakai9920
2014-03-07Reminder: You're Doing It Wrong (2010)gtirloni20
2014-08-15Think you've mastered the art of server performance? (2010)luu20
2015-09-20You're doing it wrong (2010) – Optimizing Varnisherickt30
2016-03-02You're Doing It Wrong, by phk (2010)oskarth20
2018-03-18B-Heap vs. Binary Heap (2010)Latest 20+ point returnnavinsylvester23836
2019-09-07You're doing it wrong (2010)mac0102130
2020-08-19You're Doing It Wrongkristianp20
2022-05-07You're doing server performance optimization wrong (2010)vintermann31
2025-11-18You're Doing It Wrong (Kamp 2010)xk310