SQLite improving performance with pre-sort (andersmurphy.com)
from cm0002@infosec.pub to programming@programming.dev on 30 Jun 01:19
https://infosec.pub/post/48740305

#programming

threaded - newest

LovableSidekick@lemmy.world on 30 Jun 01:37 next collapse

Good news, Everyone!
Srsly this is great!

TehPers@beehaw.org on 30 Jun 08:17 collapse

If you know a faster/better way to sort byte arrays in Java/Clojure let me know!

I don’t know much Clojure, but this should be doable in Java. I would be interested in seeing the results of sorting the data via both quicksort and heap sort. I’m not sure what sort Clojure defaults to, but if the distribution of IDs is uniform, then I’d imagine the downsides of heap sort are pretty much universal to all sorts you’re likely to use, which makes it more interesting here to me.

At the very least, Clojure’s docs seem to say that sort is stable, which isn’t needed here (we know all IDs are unique). You can probably gain performance just by switching to a performant unstable sort, just in general.