Oriel — AI & technology worth noticing, every day.

Swapping Jolt's sorted collections to a B+tree

Web page · https://yogthos.net/posts/2026-11-23-b+trees.html

First seen by Oriel on .

AI summary

Jolt replaced persistent red-black trees with persistent B+trees for sorted collections, reducing peak memory by 40% and improving most operations across collection sizes.

  • B+tree leaves hold up to 16 entries and inner nodes up to 32 children, reducing a 4-million-entry tree from 22 levels to five.
  • A full leaf uses 17 bytes per entry, compared with 48 bytes for the previous red-black representation; worst-case occupancy reaches 34 bytes.
  • Small collections built one insertion at a time were initially about 15% slower, so batch loading and ordered-input detection reduce the worst case to 1.05x.
  • At four million entries, peak resident memory fell from 1.73 GB to 1.04 GB, while Jolt remained slower than the JVM for point lookups and deletes.
  • Direct tree operations made TreeMap and TreeSet methods 4 to 70 times faster than their original implementations, though writes remain about four times slower than the JVM.

#b+trees #jolt #persistent data structures #clojure

Generated by gpt-5.6-sol. Check the original for details.

Metric trends

Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained

Points

Score reported by the source.

  • Hacker News: 33, latest observation ; +27 over observed period since
  • Lobsters: 8, latest observation ; +7 over observed period since

Comments

Comment count reported by the source.

  • Hacker News: 5, latest observation ; +4 over observed period since
  • Lobsters: 0, latest observation ; 0 over observed period since

Aliases

SourceExternal IDURL
Hacker News50628391https://yogthos.net/posts/2026-11-23-b+trees.html Read discussion
Lobsterswv9nhwhttps://yogthos.net/posts/2026-11-23-b+trees.html Read discussion