Hacker News new | ask | show | jobs
by tonymet 1312 days ago
Overall good review of profiling tactics . But there’s nothing egregious about Golang here . Pass by value vs reference is a common performance issue.
1 comments

> But there’s nothing egregious about Golang here . Pass by value vs reference is a common performance issue.

The trap here is that everything is passed by reference (pointer), but the intermediate local value is, well, a value (a copy).

Rule is not a gigantic monster struct (it's 72 bytes), chances are returning it by value would not have been an issue.

Anyway I would say there is an issue with Go here: it's way too easy to copy out of a slice.