runtime: map cold cache improvements #70835
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
There is room for improvement when some or all of a map is not in cache. The hierarchical design we use to enable incremental growth leaves us with several different allocations that can experience cache misses:
(4), (5), and (6) are in the same object, so they may share a cache line depending on how far apart they are.
Some changes that may help (or may make things worse!):
[]*table
to[]table
(prototype).table8
containing 1 group,table16
containing 2 groups, and so on up totable1024
.There is also the question of whether to store the key and value together (KVKVKV...), as we do today, or to group the keys together (KKKVVV...), as we do in the old maps. Both cases have pros and cons:
K/V together:
All keys together:
The text was updated successfully, but these errors were encountered: