Prof - Go Benchmark Profiling Made Simple
Prof automates Go performance profiling by collecting all pprof data in one command and enabling easy performance comparisons between benchmark runs.

π Documentation | βΆοΈ Watch Demo Video | βΆοΈ Watch TUI Demo
Why Prof?
Before Prof: Profiling a single benchmark with multiple profile types requires dozens of manual commands:
# Run benchmark
go test -bench=BenchmarkName -cpuprofile=cpu.out -memprofile=memory.out ...
# Generate reports for each profile type
go tool pprof -cum -top cpu.out
go tool pprof -cum -top memory.out
# Extract function-level data for each function of interest
go tool pprof -list=Function1 cpu.out > function1.txt
go tool pprof -list=Function2 cpu.out > function2.txt
# ... repeat for every function Γ every profile type
With Prof: One command collects everything and organizes it automatically.
Key Features
π One Command Profiling
Collect CPU, memory, mutex, and block profiles in a single command:
prof auto --benchmarks "BenchmarkName" --profiles "cpu,memory,mutex,block" --count 10 --tag "baseline"
Easily compare performance between different versions or optimizations:
prof track auto --base "baseline" --current "optimized" --profile-type "cpu" --bench-name "BenchmarkName"
π Regression Detection
Fail CI/CD pipelines on performance regressions with configurable thresholds:
prof track auto --base "baseline" --current "PR" --profile-type "cpu" --bench-name "BenchmarkName" --fail-on-regression --regression-threshold 5.0
Enhanced CI/CD Support: Configure function filtering, and custom thresholds to reduce noise and make CI/CD more reliable. See CI/CD Configuration Guide for details.
π Organized Output
All profiling data is automatically organized under bench/<tag>/ directories with clear structure.
π¦ Package-Level Grouping
Organize profile data by package/module for better analysis and collaboration:
# Group profile data by package when collecting
prof auto --benchmarks "BenchmarkName" --profiles "cpu,memory" --count 5 --tag "baseline" --group-by-package
# Group profile data from existing files
prof manual --tag "external-profiles" --group-by-package cpu.prof memory.prof
When enabled, this creates additional *_grouped.txt files that organize functions by their package/module, making it easier to:
- Identify which packages consume the most resources
- Share package-level performance insights with team members
- Focus optimization efforts on specific modules
Interactive TUI
Don't want to remember benchmark names or commands? Use the interactive terminal interface:
prof tui
What it does:
- π Auto-discovers all
BenchmarkXxx functions in your project
- π Interactive selection of benchmarks, profiles, count, and tag
- π― No typos - everything is selected from menus
- π Same output as
prof auto - organized under bench/<tag>/
TUI Track Mode:
Compare existing benchmark data interactively:
prof tui track
Installation
go install github.com/AlexsanderHamir/prof/cmd/prof@latest
Quick Start
- Collect profiling data:
prof auto --benchmarks "BenchmarkName" --profiles "cpu,memory,mutex,block" --count 10 --tag "baseline"
prof auto --benchmarks "BenchmarkName" --profiles "cpu,memory,mutex,block" --count 10 --tag "optimized"
- Compare performance:
prof track auto --base "baseline" --current "optimized" --profile-type "cpu" --bench-name "BenchmarkName" --output-format "summary"
Documentation
Requirements
- Go 1.24.3 or later
- Install graphviz
- A Go module (
go.mod) at the repository root
License
This project is licensed under the MIT License - see the LICENSE file for details.