2 ms·
Overall good review of profiling tactics . But there’s nothing egregious about Golang here . Pass by value vs reference is a common performance issue.
by tonymet 4y 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.
- masklinn 4y ago> 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.