bbtree
B-trees are by far the most important access path structure in database and file systems. — Jim Gray
bbtree is by far the fastest btree (ordered map):
- 5x faster than std's
BTreeMapat single thread, 12x faster thancrossbeam-skiplistat 96 threads. - 30% lower memory usage, 5x lower p99 latency.
- Zero dependencies,
no_stdcompatible. unsync::BBTreeMapis a drop-in replacement for std'sBTreeMap/BTreeSet.- Production-ready by formal verification, model checking, fuzzing, and lots of testing.
- Brought to you by decades of database research and careful curation by Xiangpeng Hao.
Checkout how it works at bbtree.xiangpeng.systems.
Usage
Concurrent bbtree
use BBTreeMap;
let map = new;
scope;
assert_eq!;
assert_eq!;
assert_eq!;
Single thread
use BBTreeMap;
let mut map = new;
map.insert;
map.insert;
assert_eq!;
Agent's guide
- Implement
InlinkeKeytrait for best performance, check how String and Vec implement it. - Consider using batching api if semantically appropriate.
- Create an issue here if you see any performance regression.
license
Licensed under either of Apache License, Version 2.0 or MIT license, at your option; LICENSE holds both texts.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in bbtree by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.