#btree-map #b-tree #collection #memory #experiment #optimization #standard

btree_experiment

Crate implements a BTreeMap similar to std::collections::BTreeMap

102 releases

0.1.106 May 17, 2024
0.1.105 May 17, 2024
0.1.91 Apr 29, 2024
0.1.39 Mar 31, 2024

#1086 in Data structures

Download history 4/week @ 2024-07-20 53/week @ 2024-07-27 29/week @ 2024-09-21 18/week @ 2024-09-28 1/week @ 2024-10-05 3/week @ 2024-10-12 103/week @ 2024-11-02

106 downloads per month

MIT/Apache

180KB
5K SLoC

Crate has moved to

https://crates.io/crates/pstd


lib.rs:

This crate implements a BTreeMap similar to std::collections::BTreeMap.

The standard BtreeMap can use up to twice as much memory as required, this BTreeMap only allocates what is needed ( or a little more to avoid allocating too often ), so memory use can be up to 50% less.

Example

    use btree_experiment::BTreeMap;
    let mut mymap = BTreeMap::new();
    mymap.insert("England", "London");
    mymap.insert("France", "Paris");
    println!("The capital of France is {}", mymap["France"]);

Features

This crate supports the following cargo features:

  • serde : enables serialisation of BTreeMap via serde crate.
  • unsafe-optim : uses unsafe code for extra optimisation.

Dependencies

~230KB