Hi, I've got a reasonably performance critical piece of code that I'm trying to profile and I suspect is being limited by the number of memory allocations I am doing. I understand a good tool is:
go test -c . -gcflags='-m' Which gives some very useful results. However I haven't found any real documentation on how to interpret the results and some of the output is puzzling me. My aim is to restructure my code so that for the critical path of the code, heap allocation is avoided whenever possible. Without sharing all the code I get a lot of things like this: ./cnt.go:420: leaking param content: prs ./cnt.go:420: leaking param content: inP Which is in reference to the following code snippet: func (prs *Proofs) MergeLst(inP proofLst) { prfLst := inP.Proofs() for i, v := range inP.Values() { prs.mrg(v, prfLst[i]) } } If I understand the message correctly the content of the variable prs is escaping, and therefore is at risk of being put on the heap. (Although I find no accompanying "escaped to Heap" message so maybe not). If the message means "A copy of the data contained in the structure referenced is being taken", then that's fine. If however it is: "Because we have seen that the function mrg requires a pointer receiver, prs needs to be allocated on the heap" then I believe that is incorrect and I need to restructure my code to avoid this. I'm pondering if the message means something else entirely, but I'm at a bit of a loss to be sure. Any thoughts appreciated. Chris -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.