from Hacker News

Indexing semantic versions in RocksDB

by adamretter on 1/3/24, 4:43 PM with 17 comments

  • by utopcell on 1/5/24, 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 zokier on 1/5/24, 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 morelisp on 1/5/24, 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 gnulinux on 1/5/24, 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 samsquire on 1/5/24, 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?