Hacker News new | ask | show | jobs
by marcus_holmes 1975 days ago
> Previously, in Go 1.10, this fixed cost was non-negligible, climbing upwards of dozens of nanoseconds. Thanks to recent improvements in the Go compiler however, as well as general improvements in CPU micro-architectures, this cost has been greatly reduced in 2020.

I read that as "used to be non-negligable, is now negligable"

4%-10% depending on compiler and architecture is pretty variable, to my way of thinking. YMMV.

also kinda random, in that there's nothing I can do in the code to determine how much overhead it costs, or change that (apart from ignoring Go's convention on error handling completely, which I'm not going to do because it wasn't a convention for performance reasons in the first place).

1 comments

You're mis-reading the text.

The reduction in cost pertains to the try/catch (defer/recover) mechanism, not error returns.

The cost of error returns has not reduced since Go 1.10.

Ah ok, thanks for correcting my mis-apprehension :)