Hacker News new | past | comments | ask | show | jobs | submit login
Profiling and Optimizing in Go (github.com/bradfitz)
116 points by mmastrac on Aug 27, 2015 | hide | past | favorite | 8 comments



The recent addition in Go 1.5 of an execution tracer is also interesting: https://golang.org/cmd/trace/


As a very green programmer, not just the tooling, but workflow blog posts and presentations like these are a god send!

I wish learn x in my y minutes could pay people, especially those with weight in their respective language communities like Brad Fitz, called Straighten Spaghetti in X by Y Minutes or Less.

I might pay for that.


I was so disappointed when I realized I couldn't profile on OSX without a kernel patch. I wonder if there is any path towards enabling that in the future.


It's a kernel bug that was reported to Apple years ago.

Fortunately, it seems that it might finally be fixed in El Capitan:

https://github.com/golang/go/issues/6047#issuecomment-135591...


Someone over at r/golang said that it might not be necessary to patch the kernel in OS X 10.11 (El Capitan). Haven't verified it myself though...


Last time I profiled Go code on a Mac, I just ran my binary as normal under Instruments. Seemed to work fine.


You can definitely do this on OSX.


To be fair, that's not always been the case. Last time I tried the profiler under OS X, it all seemed to work, but the actual figures produced by the profiler were nonsense. Other platforms seemed unaffected. That was quite a while ago. If they've fixed it, then great.

EDIT: It seems a kernel patch is required to get it to work correctly on the Mac: http://godoc.org/rsc.io/pprof_mac_fix




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: