Huh, I do not use sorted-map/sorted-set often but I would guess that they were already using B+trees. I guess I only remembered that Clojure vecs were backed by HAMTs, so I had assumed B+trees were also in use.
If you want to do large updates to B+tree, you better do it with bulk operations. I made a prototype on paper and in Python (unfinished, fails most of the tests) to do it. You provide a sorted list of deleted keys and sorted list of inserts and walk the B+ tree once, skipping unaffected branches and editing modified nodes. Not that difficult, but there are lot of small nuances. My prototype was using an immutable tree which adds some complexity.
Huh, I do not use sorted-map/sorted-set often but I would guess that they were already using B+trees. I guess I only remembered that Clojure vecs were backed by HAMTs, so I had assumed B+trees were also in use.
[delayed]
FYI it's this Jolt: https://github.com/jolt-lang/jolt
NOT this Jolt: https://github.com/jrouwe/joltphysics
Also expected the physics engine, probably because I spent the last two weeks building a Rust library on top of it so I can use it with Bevy.
Was happily surprised by a Clojure article instead, sometimes life's good :)
If you want to do large updates to B+tree, you better do it with bulk operations. I made a prototype on paper and in Python (unfinished, fails most of the tests) to do it. You provide a sorted list of deleted keys and sorted list of inserts and walk the B+ tree once, skipping unaffected branches and editing modified nodes. Not that difficult, but there are lot of small nuances. My prototype was using an immutable tree which adds some complexity.