encoding/gob: replace runtime values with constants in init() #54184
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
Current init() implementation in
encoding/gob/decode.go
checks int/uint/uintptr bit size with reflection in runtime. We could replace it with values available on compile stage. This should reduce time and allocations on binary start.Results from
GODEBUG=inittrace=1
:before:
init encoding/gob @4.4 ms, 0.21 ms clock, 43496 bytes, 652 allocs
after:
init encoding/gob @4.4 ms, 0.15 ms clock, 41672 bytes, 643 allocs
The text was updated successfully, but these errors were encountered: