Profiling Go code
Profiling is a process of dynamic program analysis that measures various values related to program execution in order to give you a better understanding of the behavior of your program. In this section, you are going to learn how to profile Go code in order to understand your code better and improve its performance. Sometimes, code profiling can even reveal bugs!
First, we are going to use the command-line interface of the Go profiler. Then, we will use the web interface of the Go profiler.
The single most important thing to remember is that if you want to profile Go code, you will need to import the runtime/pprof standard Go package, either directly or indirectly. You can find the help page of the pprof tool by executing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access