mozilla / rkv

A simple, humane, typed key-value storage solution.
https://crates.io/crates/rkv
Apache License 2.0
307 stars 52 forks source link

Optimize for non-int and non-dup-sort types of databases using features #170

Closed victorporof closed 4 years ago

victorporof commented 4 years ago

Signed-off-by: Victor Porof victor.porof@gmail.com

Our current safe mode database implementation uses a BTreeMap<Key, BTreeSet<Value>> to represent its data. This makes it so that we support the DUP_SORT database flag inherited from LMDB, which in turn allows multi-stores.

We don't use this in CRLite, so we'd incur a bit of overhead caused by the multiple levels of indirection. Making this distinction using the type system would either:

Simplest way around this is just using features.