At GopherCon Africa 2026, one of the things that caught my attention during the Go workshop was profiling.
It got me thinking about something: we spend so much time making sure our code works, but how often do we stop to ask whether it's working efficiently?
So, I did a little more reading, and here's what I learned.
So, what is profiling?
Simply put, profiling helps you understand what's happening inside your application while it's running.
Is your code using too much CPU? Is it consuming more memory than necessary? Is something slowing it down?
Instead of guessing, profiling helps you investigate what's actually happening.
And apparently, Go has a tool for this called pprof.
Why should we care?
Imagine building an application that works perfectly during development. Then more users start using it, and suddenly, things get slower.
Your first instinct might be to start changing things until performance improves. But what if you're fixing the wrong thing?
That's where profiling comes in. It helps you identify potential bottlenecks so you can focus on the parts of your code that actually need attention.
And here's the part I found particularly interesting: small improvements can have a bigger impact than we think.
If an application is wasting resources, fixing the problem could improve performance and potentially reduce infrastructure costs, especially at scale.
It's a reminder that software development isn't just about getting things to work. It's also about understanding how they work.
Where does pprof come in?
Go's pprof tooling helps developers investigate different aspects of an application's performance.
For example:
- CPU profiling helps identify where processing time is being spent.
- Memory profiling helps you understand how your application uses memory.
- Goroutine profiling helps you investigate what your goroutines are doing.
You don't necessarily need to know everything about profiling to appreciate why it matters. Even understanding what these tools can help you investigate is a good starting point.
Of course, profiling doesn't automatically fix your code. You still need to understand what the results mean, make changes, and check whether those changes actually helped.
My biggest takeaway?
Sometimes, improving software isn't about adding more features or rewriting everything.
Sometimes, it's about looking at what you already have and asking, "Could this be working better?"
I'm still learning Go, and profiling is one of those concepts that reminded me how much there is to explore beyond simply writing code that works.
One thing's for sure: I'll be paying more attention to what happens behind the scenes from now on.
If you've worked with Go before, have you used pprof? I'd love to hear about your experience!
Further reading
- Profiling Go programs
- Go diagnostics
Top comments (0)