avoid `...any` allocs in debug logs in hot loops
These lines get executed for every identifier in every package in each Go build, so one allocation per log.Printf call can quickly add up to millions of allocations across a build. Until https://go.dev/issue/53465 is fixed, the best way to avoid the escaping due to `...any` is to not perform the function call at all. name old time/op new time/op delta Build-16 10.5s ± 1% 10.5s ± 2% ~ (p=0.604 n=9+10) name old bin-B new bin-B delta Build-16 5.52M ± 0% 5.52M ± 0% ~ (all equal) name old cached-time/op new cached-time/op delta Build-16 506ms ±13% 500ms ± 7% ~ (p=0.739 n=10+10) name old mallocs/op new mallocs/op delta Build-16 31.7M ± 0% 30.1M ± 0% -5.33% (p=0.000 n=10+9) name old sys-time/op new sys-time/op delta Build-16 5.70s ± 5% 5.78s ± 6% ~ (p=0.278 n=9+10)pull/564/head
parent
3f9d77d9b6
commit
ec68fc6750
Loading…
Reference in New Issue