3 ms·
Defer overhead was mostly fixed in Go 1.14. From: https://go.dev/doc/go1.14 https://go.dev/doc/go1.14 > This release improves the performance of most uses of
by kyrra 4y ago
Defer overhead was mostly fixed in Go 1.14. From: https://go.dev/doc/go1.14 https://go.dev/doc/go1.14
> This release improves the performance of most uses of defer to incur almost zero overhead compared to calling the deferred function directly. As a result, defer can now be used in performance-critical code without overhead concerns.
EDIT: https://github.com/golang/go/issues/14939 https://github.com/golang/go/issues/14939 I believe is the main tracking bug for this.