According to our current implementation of B-trees:
|
const B: usize = 6; |
|
pub const MIN_LEN: usize = B - 1; |
|
pub const CAPACITY: usize = 2 * B - 1; |
it would appear that up to
11 key-value pairs can be stored in each node.
For u128 values representing 128 set elements each, 1408 set elements can be stored in a single allocation, with an overhead of around 50% compared to Vec<u128> in the dense case.
Such sparse bitsets would be really useful for (e.g. dataflow) analysis algorithms, in situations where the bitset elements tend to be localized, with multi-"word" gaps in between local groups.
cc @nikomatsakis @pnkfelix
According to our current implementation of B-trees:
rust/src/liballoc/btree/node.rs
Lines 53 to 55 in 5965b79
it would appear that up to
11key-value pairs can be stored in each node.For
u128values representing128set elements each,1408set elements can be stored in a single allocation, with an overhead of around 50% compared toVec<u128>in the dense case.Such sparse bitsets would be really useful for (e.g. dataflow) analysis algorithms, in situations where the bitset elements tend to be localized, with multi-"word" gaps in between local groups.
cc @nikomatsakis @pnkfelix