debug/elf: improve File.Symbols() by not using reflection #61534
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsFix
The path to resolution is known, but the work has not been done.
Performance
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Invoke
debug/elf.File.Symbols()
What did you expect to see?
Less allocations.
What did you see instead?
Some allocations which could be avoided.
Proposed fix
Currently
elf.File.Symbols()
reads symbols with reflection viabinary.Read
. We can read Symbol fields manually withByteOrder.UintXX
, this will avoid unnecessary allocations and reflection.debug/elf.diff
Before:
After:
I will be happy to submit a CL if it can be considered to be merged.
The text was updated successfully, but these errors were encountered: