Indexing semantic versions in RocksDB

by adamretteron 1/3/2024, 4:43 PMwith 17 comments

by utopcellon 1/5/2024, 5:44 PM

> "The technical primitive data structure here is a hashmap where the keys are sorted."

..somewhere, this person's algorithms teacher is pondering about his life choices.

by zokieron 1/5/2024, 5:26 PM

I don't know anything about rocksdb, but this approach on surface level seems like it could be very slow? Wouldn't it be more efficient to encode the semver in a format more suitable to sorting

by morelispon 1/5/2024, 8:19 PM

Using RocksDB here seems fairly insane unless you need to keep (at least) several billion constantly-updating versions sorted. Otherwise you can just use SortedMap and regular Java comparators.

by gnulinuxon 1/5/2024, 5:49 PM

> The technical primitive data structure here is a hashmap where the keys are sorted.

Why not a tree based map instead?

by samsquireon 1/5/2024, 6:03 PM

I am curious, I recently wrote a naive hashmap for C. I am curious about iterating in insert and sort order.

Is it possible for a hash function to maintain a sort relationship to it's input and output?