#collection #memory #hash-map #sparse #index #indices #usize

densevec

Map like collection with usize indices that stores values contiguosly

11 unstable releases (4 breaking)

Uses old Rust 2015

0.5.1 Jul 7, 2022
0.4.0 May 26, 2022
0.3.5 Apr 16, 2020
0.3.4 Dec 3, 2019
0.1.0 Mar 16, 2018

#1927 in Data structures

MIT license

61KB
1.5K SLoC

DenseVec

Map like collection with usize indices that stores values contiguosly in memory so iterating through them is as fast as iterating a vector.

The index uses a sparse vector so using very high numbers will lead to high memory usage

The API mimics that of HashMap and implements all it's features + some methods that are useful in this case like get_unchecked(_mut).

Dependencies

~0–425KB