3 A speedy hash algorithm used within rustc. The hashmap in liballoc by
4 default uses SipHash which isn't quite as speedy as we want. In the
5 compiler we're not really worried about DOS attempts, so we use a fast
6 non-cryptographic hash.
8 This is the same as the algorithm used by Firefox -- which is a
9 homespun one not based on any widely-known algorithm -- though
10 modified to produce 64-bit hash values instead of 32-bit hash
11 values. It consistently out-performs an FNV-based hash within rustc
12 itself -- the collision rate is similar or slightly worse than FNV,
13 but the speed of the hash function itself is much higher because it
14 works on up to 8 bytes at a time.
19 use rustc_hash::FxHashMap;
20 let map: FxHashMap<u32, u32> = FxHashMap::default();