Let's state a collection of key/values.
Key is an unsigned integer (0 - 2^32-1). Hense there are comparable. Value is few bytes fixed size.
There are 4M items in the collection. Keys are not evenly spread in the key space i.e there is no way to predict hole size between two consecutive keys.
This collection is created once and never modify after that, even if not prohibited.
The aim is to lookup a value by its key. But if key is not found then the previous one (as in integer natural order) must be returned.
I'm looking for a data-structure that can be mmap on disk which would be reasonably space efficient but most importantly very time efficient for the lookup function.
There is no known pattern on how the keys are queried.