Hacker News new | ask | show | jobs
by barsonme 663 days ago
> IMO it is a questionable decision to spend CPU resources on randomization …

It takes about 3 ns to choose a random starting bucket, which is basically free relative to the iteration itself.

1 comments

Isn't the trick that the runtime picks another hash-constant every time?
Aside from keying the hash function, Go specifically randomises the start offset of each map iteration.