-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
FrozenDueToAgePerformanceearly-in-cycleA change that should be done early in the 3 month dev cycle.A change that should be done early in the 3 month dev cycle.
Milestone
Description
package p
import "testing"
//go:noinline
func defers() (r int) {
defer func() {
r = 42
}()
return 0
}
func BenchmarkDefer(b *testing.B) {
for i := 0; i < b.N; i++ {
defers()
}
}
On my system, BenchmarkDefer uses 77.7ns/op. This issue
arises from investigation of #9704: if I remove the "defer endcgo(mp)"
and place the call at the end of the func cgocall, the benchmark in
#9704 will improve from 144ns/op to 63.7ns/op. (Note: we can't
eliminate the defer in func cgocall though, as it will break defer/recover
in Go->C->Go scenario.)
iand, BenLubar, prashantv, aaronbee, schancel and 26 more
Metadata
Metadata
Assignees
Labels
FrozenDueToAgePerformanceearly-in-cycleA change that should be done early in the 3 month dev cycle.A change that should be done early in the 3 month dev cycle.