Package fastinteger is designed to provide a very primitive implementation of a hash map for unsigned integer keys and values. It is designed to have existence checks and insertions that are faster than Go's native implementation. Like Go's native implementation, FastIntegerHashMap will dynamically grow in size.
Current benchmarks on identical machine against native Go implementation:
BenchmarkInsert-8 10000 131258 ns/op BenchmarkGoMapInsert-8 10000 208787 ns/op BenchmarkExists-8 100000 15820 ns/op BenchmarkGoMapExists-8 100000 16394 ns/op BenchmarkDelete-8 100000 17909 ns/op BenchmarkGoDelete-8 30000 49376 ns/op BenchmarkInsertWithExpand-8 20000 90301 ns/op BenchmarkGoInsertWithExpand-8 10000 142088 ns/op
This performance could be further enhanced by using a better probing technique.
package fastinteger // hash will convert the uint64 key into a hash based on Murmur3's 64-bit
package fastinteger import (
// This performance could be further enhanced by using a // better probing technique. package fastinteger const ratio = .75 // ratio sets the capacity the hashmap has to be at before it expands