Profiling Your Tool
Go provides several tools to help you analyze your programs for performance-related issues. You’ve already seen the benchmarking feature and how you can use it to accurately determine how fast your programs execute. In addition to benchmarks, Go provides two analytical tools to help you find contentions or bottlenecks in your programs: the profiling and tracing tools.
You’ll explore the tracing tool in Tracing Your Tool. For now, let’s dive into the profiling tool.
The Go profiler shows you a breakdown of where your program spends its execution time. By running the profiler, you can determine which functions consume most of the program’s execution time and target them for optimization.
You have two ways to enable profiling ...
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