Open
Description
I was reviewing some code for performance issues, and the profile pointed me to a function that was accessing the same map element multiple times like this:
data[key].Foo = 1
data[key].Bar.Baz += 4
[...]
The profile showed many calls to runtime.mapaccess1_fast32
. I was wondering if it would be legal for the compiler to optimize this straight code to do only one map access, and then of course if it's worth doing it or not.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Triage Backlog