Skip to content

A small set implementation in Rust with minimal heap allocations.

License

Notifications You must be signed in to change notification settings

cfallin/rust-smallset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smallset: a small unordered set

Build Status

crates.io

Documentation

This crate implements a small unordered-set data structure implemented using smallvec. It stores set elements in a simple unordered array, and when the set is smaller than a parameterizable size, the elements are stored completely inline (i.e., with zero heap allocations). The data structure is thus very space-efficient for sets of only a few elements, much more so than a tree-based or hash-table-based set data structure. It is also fast when the set is small: queries and inserts perform a linear scan, which is more cache-friendly than a pointer-chasing search through a tree.

smallset should be used where minimizing heap allocations is of primary importance and where it is expected that no more than a few elements will be present. If the set grows large, then it will exhibit poor (O(n) queries and inserts) performance.

About

A small set implementation in Rust with minimal heap allocations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published