Skip to content

Basic example of CPU Profiling in Golang which shows the bottlenecks and how much time is spent per function

Notifications You must be signed in to change notification settings

felipeaz/cpu-profiling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

cpu-profiling

Basic example of CPU Profiling in Golang which shows the bottlenecks and how much time is spent per function

Generate cpu.prof

Run the following command to create the cpu.prof file

go test -cpuprofile cpu.prof -bench .=

Analyze functions

First connect to pprof by running the command go tool pprof cpu.prof

Then, run the list command followed by the function name

list nonDivisibleSubset

list generateSubset

list updateSubset

About

Basic example of CPU Profiling in Golang which shows the bottlenecks and how much time is spent per function

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages