pkg/profile
pkg/profile has 2,054 GitHub stars and 121 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-07 00:02 UTC. Last push 2022-10-20.
Simple profiling for Go
Measured star growth
- in 24h
- 0
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalprofile
Simple profiling support package for Go
installation
go get github.com/pkg/profile
usage
Enabling profiling in your application is as simple as one line at the top of your main function
import "github.com/pkg/profile"
func main() {
defer profile.Start().Stop()
...
}
options
What to profile is controlled by config value passed to profile.Start. By default CPU profiling is enabled.
import "github.com/pkg/profile"
func main() {
// p.Stop() must be called before the program exits to
// ensure profiling information is written to disk.
p := profile.Start(profile.MemProfile, profile.ProfilePath("."), profile.NoShutdownHook)
...
// You can enable different kinds of memory profiling, either Heap or Allocs where Heap
// profiling is the default with profile.MemProfile.
p := profile.Start(profile.MemProfileAllocs, profile.ProfilePath("."), profile.NoShutdownHook)
}
Several convenience package level values are provided for cpu, memory, and block (contention) profiling.
For more complex options, consult the documentation.
contributing
We welcome pull requests, bug fixes and issue reports.
Before proposing a change, please discuss it first by raising an issue.
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,737 starspublic-apis/public-apis
A collective list of free APIs
496,962 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
440,455 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,130 stars