Skip to main content

Crate embed_seglist

Crate embed_seglist 

Source
Expand description

§SegList

SegList is a replacement for linked list, and Vec (when you don’t need random access)

Various is designed for parameter passing, which wraps Option & SegList, when the optimal condition is empty or one.

More CPU-cache friendly compared to LinkedList. And because it does not re-allocate, it’s faster than Vec::push() when the number of elements is small. It’s nice to the memory allocator (always allocate with fixed size segment).

Benchmark: append + drain (x86_64, cache line 128 bytes):

(platform: intel i7-8550U)

ElementsSegListVecSegList vs Vec
1040.5 ns147.0 ns3.6x faster
3299.1 ns237.8 ns2.4x faster
100471.1 ns464.0 ns~1.0x
5002.77 µs895.5 ns3.1x slower

Re-exports§

pub use various::Various;
pub use seglist::SegList;

Modules§

seglist
SegList : A segmented list with cache-friendly node sizes.
various
Various: A small-list optimization container for efficient parameter passing.