Skip to main content

Crate kevy_map

Crate kevy_map 

Source
Expand description

kevy-map — a purpose-built open-addressing hashtable for kevy’s keyspace.

Per-shard, single-threaded, single-trust-domain. Trades std::HashMap’s generality for three kevy-specific wins:

  1. Bucket-address API (prefetch_for_hash, future) — exposes the table’s bucket metadata pointer so the command-batch driver can prefetcht0 the next command’s group while finishing the current.
  2. No DoS-hardening tax — single trust domain ⇒ no random seed. Hasher is kevy_hash::KevyHash (one-call inlinable).
  3. Cache-conscious layout — Swiss-style metadata bytes scanned (scalar in this commit; SSE2 group scan lands in a later pass); slots AoS so the post-match key+value read hits one cache line.

See the crate README for the design rationale.

Constraints: pure Rust, no crates.io deps; unsafe is allowed here (scoped to this crate) so kevy-store keeps forbid(unsafe_code).

Structs§

Iter
(&K, &V) iterator over all live entries of a KevyMap; order unspecified.
IterMut
(&K, &mut V) iterator over all live entries of a KevyMap; order unspecified. Keys stay shared — mutating a key would corrupt its bucket.
KevyMap
An open-addressing Swiss-style hashtable keyed by KevyHash.
KevySet
HashSet-shaped wrapper over KevyMap<K, ()>.
Keys
&K iterator over all live entries of a KevyMap.
SetIter
&K iterator over all members of a KevySet; order unspecified.
Values
&V iterator over all live entries of a KevyMap.

Traits§

KevyHash
Single-call hashing for kevy’s per-command hot path.