Live data from Hacker News

Indexing semantic versions in RocksDB

blog.aawadia.dev

1–10 of 18 posts

Re: Indexing semantic versions in RocksDB

#6

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?

If you iterate a python dictionary it will return the keys in insert order.

For sort order you need to sort separately.

Re: Indexing semantic versions in RocksDB

#7
post #2

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

Sure, the old performance/productivity tradeoff.

This quickly solves the problem then you can iterate for performance.

Re: Indexing semantic versions in RocksDB

#8
post #4

> The technical primitive data structure here is a hashmap where the keys are sorted. Why not a tree based map instead?

HashMap and sorted keys sounds like a contradiction. I think they just use "HashMap" as a generic term for "Map" and it's actually a tree based map.

Re: Indexing semantic versions in RocksDB

#10
post #4

> The technical primitive data structure here is a hashmap where the keys are sorted. Why not a tree based map instead?

HashMap and sorted keys sounds like a contradiction. I think they just use "HashMap" as a generic term for "Map" and it's actually a tree based map.

It is an LSMT, but I cannot imagine why they would need one here.
Post reply on HN