Module map_with_dict_bitpacked

Module map_with_dict_bitpacked 

Source
Expand description

A module offering MapWithDictBitpacked, an efficient, immutable hash map implementation.

MapWithDictBitpacked is a specialized version of MapWithDict optimized for memory usage by bit-packing its values. It uses a minimal perfect hash function (MPHF) for key indexing. Unlike MapWithDict, this variant stores unique Vec<u32> values bit-packed to the minimum possible number of bits in the byte dictionary. All values vectors must have same length, so that we don’t need to store it which further reduces memory footprint of data structure.

The structure excels in scenarios where values are within a limited range and can be encoded efficiently into bits. The MPHF grants direct key index access, mapping to bit-packed values stored in the byte dictionary. Keys are maintained for validation during retrieval. A get query for a non-existent key at construction returns false, similar to MapWithDict.

Structs§

MapWithDictBitpacked
An efficient, immutable hash map with bit-packed Vec<u32> values for optimized space usage.

Enums§

Error
Errors that can occur when constructing MapWithDictBitpacked.