4 ms·
Isn't it similar to what happens in other languages? In example, in C++ std::maps are implemented as RB trees, are::vectors instantiate 50% (sometimes 100%) mo
by rippeltippel 4y ago
Isn't it similar to what happens in other languages?
In example, in C++ std::maps are implemented as RB trees, are::vectors instantiate 50% (sometimes 100%) more memory than requested, etc. All of that happens under the bonnet in order to fulfill the performance guarantees of the language.
IIRC, one of the most widely quoted memes in Clojure space goes along the lines of "simple != easy". Or better (not= :simple :easy)
- pjmlp 4y agoTraditionally most C++ implementations use RB trees, the standard doesn't require it to be so, all data structures requirements are described via big O notation.
- zabzonk 4y agoexcept that if you don't use a rb tree, you will have a hard time meeting the performance requirements
- pjmlp 4y agoKind of, if tomorrow someone comes up with funky zombie trees with the same O() characteristics, or even better, they can ship them on their C++ standard library. And then some clever C++ developers that have code that depends on rb tree's behaviours, would cry that their cheese was moved and their code doesn't work as before, even though nothing prevented funky zombie trees to be shipped instead.