In our application, we use std::mapto store data (key, value) and use serialization to store this data on disk. With this approach, we find that disk I / O is a performance bottleneck, and finding values using a key is not very fast.
I came across LevelDB and thought about using it. But I have some questions.
- The LevelDB documentation says that it is made for a pair of values (string, string). Does this mean that I cannot use key values for custom pairs?
- It seems that the difference between
std::mapand LevelDB is that LevelDB is permanent, but std::mapworks in memory. Does this mean that an I / O disk bottleneck would be more problematic for levelDB.
In particular, can anyone explain if LevelDB could be a better choice than std::map?
PS: I tried to use hash_map, but it looks slower thanstd::map
source
share