3 ms·
This sounds very much like "write code to please escape analysis", but with a profiling step in front of it.
by staticassertion 8y ago
This sounds very much like "write code to please escape analysis", but with a profiling step in front of it.
- kristianp 8y agoNo, there's a difference. Profiling will often show you where you're doing allocations or calling code that does allocations in the most often used code. Profiling shows where to reduce those allocations to get the biggest improvements. When making the changes, you don't try to reduce escapes, you reduce allocations. Have a look at [1] and go down to where it says " To find out why the garbage collector is running so much". [1] https://blog.golang.org/profiling-go-programs https://blog.golang.org/profiling-go-programs