Module massa_models::prehash

source ·
Expand description

pre-hashed trait, for hash less hashmap/set

Structs

  • A Hasher for PreHashed keys that is faster because it avoids re-hashing hashes but simply truncates them. Note: when truncating, it takes the last 8 bytes of the key instead of the first 8 bytes. This is done to circumvent biases induced by first-byte manipulations in addresses related to the thread assignment process

Traits

  • Trait allowing pre-allocations
  • A trait indicating that its carrier is already a hash with at least 64 bits and doesn’t need to be re-hashed for hash-table purposes

Type Aliases

  • BuildHasherDefault specialization for HashMapper
  • HashMap specialization for PreHashed keys This hashmap is about 2x faster than the default HashMap
  • HashSet specialization for PreHashed keys This hashset is about 2x faster than the default HashSet