Skip Navigation

TIL pprof is a thing

Found myself trying to debug an issue with memory not being garbage collected in a program. It turns out go comes with a tool that shows you the different memory allocations and resource hogs between different goroutines. Super useful so far from what I've found on some basic debugging, but still trying to understand how the flamegraph, the visualizations when writing to a png, and some other utilities in there work.

Overall was happy to learn that there was included tooling for that purpose within go itself.

6

You're viewing a single thread.

6 comments
  • Go's tooling is second to none; it's one of the things I like best about it. The sheer number of debugging, benchmarking, live and static analysis tools is enterprise-level.

    I will say, while having unit testing as a first-class supported function is fantastic, the test package is a big anemic. I had been using Ruby a lot when I first got into Go, and it was almost harder to write Ruby without doing test-driven development; it was so fantastically easy, it changed my entire vie perspective on unit tests. Go is... harder. There are no assertions built into the test package, mocking is a PITA, and all of those great Go language safety features make writing tests harder. Yes, there are a lot of this party tools to address these things, but honestly I wish testing had been a bit more built-out. Many of the defacto standard testing practices still dominant today were already well established by the time Go was released; there really was little reason not to provide more tools to make writing tests easier, and thereby encourage test-driven development.

    But, really, it's a fairly minor grievance, and far too late to address.

6 comments