This is a very simple implementation of this crazy method of making read only hashs become faster with no collisions.
A very simple implementation of this crazy method of making read only hashs become faster with no collision, normally use GPERF for that is much more robust then this simple test code. This proves that the Odin hash function is really really fast. We can beet it but just for a small ammount.
MPHF - Minimum Perfect Hashing Function : 10.98 ns
Normal Odin Haspmap get : 13.27 ns
Running benchmark for 100000000 existing keys...
- Total time: 964.354865ms seconds
- Mean lookup time: 9.64 ns
Running benchmark for 100000000 existing keys with strings...
- Total time: 1.097790787s seconds
- Mean lookup time: 10.98 ns
Generating 9001 non-existing keys for benchmark...
Running benchmark for 100000000 non-existing keys...
- Total time: 1.530092068s seconds.
- Mean lookup time: 15.30 ns.
Finished populating the Odin hashmap. Size of the map: 9001
Beginning benchamarking Normal Odin HaspMap...
Benchmark result
Number of iterations of benchmark: 100000000
Total time: 1.3271 segundos
Medium time for each get : 13.27 ns
MIT Open Source License
Best regards,
João Carvalho