Crates.io | entropy-map |
lib.rs | entropy-map |
version | 1.0.0 |
source | src |
created_at | 2024-10-18 01:05:10.187777 |
updated_at | 2024-10-18 01:05:10.187777 |
description | Ultra-low latency hash map using minimal perfect hash functions and compact encoding of values, minimizing memory footprint and storage size for efficient data retrieval. |
homepage | |
repository | https://github.com/cloudflare/entropy-map |
max_upload_size | |
id | 1413756 |
size | 136,027 |
entropy-map
is an ultra-low latency hash map Rust crate using minimal perfect hash functions (MPHF) and compact encoding of values, designed for scenarios where both memory efficiency and fast data retrieval are critical. Ideal for applications in high-performance computing, entropy-map
offers a unique blend of speed and compactness.
Simple example to quickly get started:
use entropy_map::Mphf;
let keys = [1, 2, 3, 4, 5];
let mphf = Mphf::<32, 8>::from_slice(&keys, 2.0).unwrap();
assert!(mphf.get(&1).is_some());
Check out the provided examples for detailed usage:
This crate provides advanced data structures leveraging MPHF, optimized for scenarios requiring high-speed data access and minimal memory usage. It includes the following key components:
2.10 bits
to 2.71 bits
per key depending on parameters.5 ns
to 20 ns
depending on the parameters, number of keys and L1-L3 cache sizes.B
: group size in bits in [1..64] range, default 32 bits.S
: defines maximum seed value to try (2^S) in [0..16] range, default 8.ST
: seed type (unsigned integer), default u8
.H
: hasher used to hash keys, default WyHash
.gamma
parameter to tune construction time vs query time trade-off.rkyv::ArchivedHashMap
.MapWithDict
, further optimized for memory usage when values are Vec<u32>
.Vec<u32>
values for minimal space usage using SIMD instructions.Special case of MapWithDict
, optimized for set membership operations.