Menu

📰
0

Wrote an alternate BTreeMap with const Layout

Reddit r/rust·u/frostyplanet·about 1 month ago
#J6IjACzD
Reading 0:00
15s threshold

Wrote an alternate BTreeMap with const Layout Due to the need for special **cursor** api, (and cursor feature in std is not stable yet), I've spent a month writing an alternate version of BTreeMap. The intended scenarios are for integer keys with a large and long-lived dataset. The result is satisfying. doc: [https://docs.rs/embed-collections/latest/embed\_collections/btree/](https://docs.rs/embed-collections/latest/embed_collections/btree/) repo: [https://github.com/NaturalIO/embed-collections-rs](https://github.com/NaturalIO/embed-collections-rs) I have done a little investigation of std implementation before I started: * The std impl is pure btree (not b+tree) without horizontal links. Each key store only once at either leaf and inter nodes. * The std impl is optimised for point lookup (target key may be at InterNode) * The std impl has fixed Cap=11, node size varies according to T.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More