Our great sponsors
-
HashSet is a hash set implementation based on the open-addressing algorithm hopscotch hashing. The motivation for using HashSet[E comparable] over using type Set[E comparable] map[E]struct{} is mainly due to the improved speed and memory usages. It uses internal hash functions exported from runtime. Originally, I used hash/maphash, but this proved to be very slow(at least on my end) compared to the private hash functions used by native map in package runtime.
-
I recommend writing more thorough benchmarks as in https://github.com/golang/go/blob/master/src/runtime/map_benchmark_test.go. Currently your implementation only benchmarks the basic cases -- which, of course, is fine if that's all the cases you need to support. If you mention a disadvantage, then I would expect to see that in the benchmark.
-
InfluxDB
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
-
All of this is nitpicking really, but I would suggest using linters, e.g. https://github.com/golangci/golangci-lint - sometimes annoying, but mostly just helps to avoid discussions like this (and plethora of bugs).