3 ms·
Coincidentally I was just watching this talk from Bryan Cantrill: https://youtu.be/vvZA9n3e5pc https://youtu.be/vvZA9n3e5pc. Around the 58 minute mark he shares
by sanderjd 5y ago
Coincidentally I was just watching this talk from Bryan Cantrill: https://youtu.be/vvZA9n3e5pc https://youtu.be/vvZA9n3e5pc. Around the 58 minute mark he shares an anecdote that is relevant to this thread. It boils down to him doing something where he would have written a simple bespoke balanced binary tree in C, but when writing a reimplementation in Rust used a "naive" library approach and was surprised to see a 35% speedup, which boiled down to the library using a btree instead of a balanced binary tree.
This doesn't invalidate your point about there being use cases for binary trees that may necessitate you to write your own, I take you at your word that you've often had strong use cases for this, but I do think it illustrates something I believe to be true, which is that people reach for linked data structures too often, when contiguous ones are a better default.