Skip to main content

Crate pulse_map

Crate pulse_map 

Source
Expand description

§PulseMap

A CPU cache-line hash table with zero-cost eviction.

Every bucket fits in exactly one 64-byte cache line with embedded LFU+LRU eviction metadata. Eviction decisions require zero additional cache misses because the priority data lives inside the metadata word that was already fetched for the fingerprint check.

§Quick Start

use pulse_map::PulseMap;

let mut map = PulseMap::new(1024);
map.insert(b"hello", b"world");
assert_eq!(map.get(b"hello"), Some(&b"world"[..]));
map.remove(b"hello");
assert_eq!(map.get(b"hello"), None);

§Typed Usage

use pulse_map::TypedPulseMap;

let mut map = TypedPulseMap::<u32, u64>::new(256);
map.insert(42, 100);
assert_eq!(map.get(&42), Some(100));

Structs§

Bucket
A 64-byte cache-line-aligned bucket containing metadata and 4 slots.
ConcurrentPulseMap
Thread-safe PulseMap with per-bucket locking and optional dynamic resize.
MetaWord
64-bit metadata word containing state, fingerprints, and priority for 4 slots.
OccupiedEntry
A view into an occupied entry in a TypedPulseMap.
PulseMapRaw
Raw byte-level cache-line hash table with zero-cost eviction and optional TTL.
RawIter
Iterator over raw (&[u8], &[u8]) key-value pairs in a PulseMapRaw.
ShardedPulseMap
Thread-safe PulseMap sharded across 16 independent ConcurrentPulseMaps.
Slot
14-byte slot that stores either inline key+value or a slab pointer.
TypedIter
Iterator over typed (K, V) pairs in a TypedPulseMap.
TypedPulseMap
A typed cache-line hash table with zero-cost eviction.
VacantEntry
A view into a vacant entry in a TypedPulseMap.

Enums§

Entry
A view into a single entry in a TypedPulseMap.
SlotState
Slot state in the metadata word.

Traits§

PulseKey
Trait for types that can be used as PulseMap keys.
PulseValue
Trait for types that can be used as PulseMap values.

Type Aliases§

PulseMap
A CPU cache-line hash table with zero-cost eviction.