4 ms·
> I've not heard of Go maps being very high load factors, so they probably resize around 50% or so full. Go uses a load factor of 6.5 (expressed as average loa
by LukeShu 4y ago
> I've not heard of Go maps being very high load factors, so they probably resize around 50% or so full.
Go uses a load factor of 6.5 (expressed as average load of a bucket; where buckets have a maximum load of 8; i.e. 81% full) (ref: https://github.com/golang/go/blob/go1.19.3/src/runtime/map.go#L33-L72 https://github.com/golang/go/blob/go1.19.3/src/runtime/map.g... )
> I’ll assume … doubling on resize
Indeed (ref: https://github.com/golang/go/blob/go1.19.3/src/runtime/map.go#L19-L20 https://github.com/golang/go/blob/go1.19.3/src/runtime/map.g...)