Mastodon Feed: Post

Mastodon Feed

nadim@symbolic.software ("Nadim Kobeissi") wrote:

In this blog post, the author made a Go program go 1.7x faster by avoiding a heap allocation: https://hmarr.com/blog/go-allocation-hunting/

I love Go, but this post gave me my first genuine reason to have a problem with the language.

The way in which the allocation was avoided (see photo) is totally arbitrary, and nothing about the language indicates that the original code or the change would avoid a heap allocation.

Rust doesn't have this issue: the language semantics inform you of the performance you can expect.

Attachments: