0

yogthos.net · 10d · discuss

Until recently, sorted-map and sorted-set in Jolt were a straight port of Clojure's PersistentTreeMap, which is backed by a persistent red-black tree. Using a red-black tree has worked well for Clojure, and it provides a solid foundation for backing these data structures. However, red-black trees have a downside, which is that every entry gets its own small node, meaning that every step of a lookup follows a pointer to a different place in memory.So, naturally I got curious to see if a different data structure could be used for the same job which might have a lower overhead. Turns out...