Skip to main content

AttrsMap

Type Alias AttrsMap 

Source
pub type AttrsMap<K, V> = HashMap<K, V, FxBuildHasher>;
Expand description

Compact attrset map — a real hashbrown (std) HashMap with FxBuildHasher.

Used ONLY for NixAttrs (attribute sets), which are immutable-after- construction. Unlike FxHashMap (the persistent im_rc HAMT, retained for Env where child()/scope-push relies on O(1) structural sharing), this is a flat open-addressing table with ~0.875 load factor and NO branch-node allocations — a symbolicated dhat profile proved the im_rc HAMT branch nodes dominate eval heap, and the attrset slice is the safe one to compact.

BYTE-NEUTRAL: attrset observation order (which feeds drvPath hashing) comes from NixAttrs::sorted_entries() — it resolves each Symbol to its String and string-sorts on observation — NOT from this map’s internal iteration order. Both im_rc::HashMap and std::HashMap are unordered, so swapping the implementation cannot change any observed order → drvPaths are unchanged.

Aliased Type§

pub struct AttrsMap<K, V> { /* private fields */ }