cmd/compile: allocation when string key already exists in a map when using map[string([]byte{})] #52971
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
Modify an existing string key value within a map, causes an allocation when using string([]byte{}) conversion, whereas using a string direct doesn't.
https://go.dev/play/p/q5XXrMngkZV
What did you expect to see?
0 allocations for when using map[string([]byte{})] when the map contains the key.
What did you see instead?
1 allocation using map[string([]byte{})] when the map contains the key.
The text was updated successfully, but these errors were encountered: