maps: Equal should not allocate on the heap #65329
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Go version
go1.21.6 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Ran the memory profiler for my application.
What did you see happen?
I saw that frequently iterating through a map with type

map[uint16]uint32
was causing memory pressure.maps.Equal
performs an iteration on one map and indexes into the other.What did you expect to see?
I expected to be able to iterate over a map without allocating on the heap. Surely we can make
maps.Equal
not allocate on the heap. It seems that stepping through the bucket list shouldn't require a nondeterministic amount of memory.The text was updated successfully, but these errors were encountered: