As further protection, when the size of a non-tiny map drops to zero, we should update its hash seed. This is a reminder issue.
See discussion in CL 110055.
cc @martisch @randall77
Just curious: why not do the same when map growing is initiated? Is there something preventing the new/bigger map storage to use a different seed?
The way we grow the map, it isn't possible. Each original bucket evacuates to just two new buckets. The hashes need to agree on all the common bits.
There might be other growing algorithms where it could work.
Punting to unplanned. Pretty low priority.
Change https://golang.org/cl/253020 mentions this issue: runtime: opportunistically rotate map key seed
While https://golang.org/cl/253020 resets the seed when the map clear idiom is used it doesnt reset the seed when maps are emptied to zero elements by just deleting elements without ranging over all the keys or when the pattern for map clear is not triggered. I think this is done in map clear we should also do it on deleting if an element is deleted and the maps length drops to 0.
Change https://golang.org/cl/252940 mentions this issue: runtime: rotate map key seed when delete last element
Most helpful comment
While https://golang.org/cl/253020 resets the seed when the map clear idiom is used it doesnt reset the seed when maps are emptied to zero elements by just deleting elements without ranging over all the keys or when the pattern for map clear is not triggered. I think this is done in map clear we should also do it on deleting if an element is deleted and the maps length drops to 0.