Profiling is a practice that can be used to measure the resources utilized in a computer system. Profiling is often done to understand the CPU or memory utilization within a program in order to optimize for execution time, size, or reliability. Alongside profiling, in this chapter, we are going to learn the following:
- How to profile requests in Go with pprof
- How to compare multiple profiles
- How to read the resulting profiles and flame graphs
Performing profiling will help you to deduce where you can make improvements within your function and how much time individual pieces take within your function call with respect to the overall system.