Closed petermattis closed 9 months ago
This is pretty much exactly https://github.com/cockroachdb/cockroach/pull/118742. Rather than fleshing out all of the TODOs and having you re-review the code again, I felt it might be easier to review this as-is, get it checked in and follow up with subsequent PRs to address the TODOs and set up CI.
A
swiss.Map
has similar or slightly better performance than Go's builtin map for small map sizes, and is much faster at large map sizes (old=go-map, new=swissmap):A
swiss.Map
dominates the performance of the RobinHood map used by Pebble's block-cache (old=robinhood, new=swissmap):The inspiration behind writing a Go implementation of Swiss Tables came from https://github.com/dolthub/swiss. That implementation is quite a bit slower and does not follow the original design (the slots are divided into groups which do not overlap).