140 releases (87 breaking)

new 0.107.0 Apr 22, 2024
0.106.0 Mar 20, 2024
0.105.4 Apr 11, 2024
0.103.0 Dec 20, 2023
0.25.0 Nov 27, 2018

#274 in Data structures

Download history 90731/week @ 2024-01-03 97580/week @ 2024-01-10 110375/week @ 2024-01-17 98990/week @ 2024-01-24 106645/week @ 2024-01-31 108503/week @ 2024-02-07 102201/week @ 2024-02-14 107060/week @ 2024-02-21 111758/week @ 2024-02-28 116175/week @ 2024-03-06 115961/week @ 2024-03-13 120914/week @ 2024-03-20 108125/week @ 2024-03-27 128123/week @ 2024-04-03 129709/week @ 2024-04-10 95092/week @ 2024-04-17

480,584 downloads per month
Used in 435 crates (via cranelift-codegen)

Apache-2.0 WITH LLVM-exception

235KB
5K SLoC

This crate contains array-based data structures used by the core Cranelift code generator which represent a set of small ordered sets or maps.

These are not general purpose data structures that are somehow magically faster that the standard library's BTreeSet and BTreeMap types.

The tradeoffs are different:

  • Keys and values are expected to be small and copyable. We optimize for 32-bit types.
  • A comparator object is used to compare keys, allowing smaller "context free" keys.
  • Empty trees have a very small 32-bit footprint.
  • All the trees in a forest can be cleared in constant time.

lib.rs:

A forest of B+-trees.

This crate provides a data structures representing a set of small ordered sets or maps. It is implemented as a forest of B+-trees all allocating nodes out of the same pool.

These are not general purpose data structures that are somehow magically faster that the standard library's BTreeSet and BTreeMap types.

The tradeoffs are different:

  • Keys and values are expected to be small and copyable. We optimize for 32-bit types.
  • A comparator object is used to compare keys, allowing smaller "context free" keys.
  • Empty trees have a very small 32-bit footprint.
  • All the trees in a forest can be cleared in constant time.

Dependencies