JesperAxelsson / rust-intmap

Specialized hashmap for u64 keys
MIT License
30 stars 10 forks source link

Support more integer types #61

Open jakoschiko opened 3 weeks ago

jakoschiko commented 3 weeks ago

Mostly ran out of motivation. And back when I started writing this project const compilation weren't ready yet. Changing the constant used during hashing should be enough to support different int types. I thought about being able to select growth algo. Now IntMap use power of two which is quite easy and fast but can be wasteful. Most other hashmaps use increase in switch statement with fixed primes. This might be possible to do the same way as the std hashmap injects hashers. The biggest downside I see is increased complexity. IntMap is pretty readable right now. The more you introduce generics and type level programming the more complicated it becomes. The standard hashmap can be a bit tricky to read.

Originally posted by @JesperAxelsson in https://github.com/JesperAxelsson/rust-intmap/issues/56#issuecomment-2279869367