A fast HashSet implementation

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • InfluxDB - Access the most powerful time series database as a service
  • SonarQube - Static code analysis for 29 languages.
  • SaaSHub - Software Alternatives and Reviews
  • Go-Utils

    Some parallel and less known but good data structure

    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.

  • go

    The Go programming language

    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.

  • golangci-lint

    Fast linters Runner for Go

    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).

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts