px_core/hash.rs
1//! Fast hash-map aliases for hot-path collections.
2//!
3//! stdlib `HashMap` uses SipHash-1-3. For the short string keys that dominate
4//! WS state (asset IDs, market IDs, outcome names) ahash is ~3-5x faster on
5//! insert/lookup and DoS-resistance is not a concern for internal state.
6//!
7//! Usage is opt-in — don't force-migrate every `HashMap`; use this only where
8//! profiling shows hashing in the top of the flamegraph.
9
10use std::collections::{HashMap, HashSet};
11
12pub type FastHashMap<K, V> = HashMap<K, V, ahash::RandomState>;
13pub type FastHashSet<T> = HashSet<T, ahash::RandomState>;