SlowJam: latency profiler for Go programs
253
stars
82
commits
HTML
primary language
Aug 13, 2026
updated

NOTE: This is not an officially supported Google product
SlowJam is a two-part tool for analyzing function latency within Go programs.
stacklog - a library for sampling the stack of a Go program during runtimeslowjam - a binary for visualizing the latency from recorded stack samplesSlowJam excels at finding optimization opportunities in automation workflows, as they tend to block on command-line execution or remote resources, rather than CPU resources. This tool was created from a hackathon hosted by Google's Container DevEx team, with the goal of finding ways to reduce the start-up latency within minikube.

See example/minikube.html for example output.
Add this to the main() method of your program, or within any other function you wish to record stack samples for:
s := stacklog.MustStartFromEnv("STACKLOG_PATH")
defer s.Stop()
This will invoke the stack sampler if the STACKLOG_PATH environment is set, and will write the stack samples to that location. If you prefer greater control over the configuration, you can also use:
cfg := stacklog.Config{
Path: "out.slog",
Poll: 100 * time.Millisecond,
Quiet: true
}
s, err := stacklog.Start(cfg)
defer s.Stop()
By default, this will poll the stack every 125ms.
Install slowjam:
go install github.com/google/slowjam/cmd/slowjam@latest
Analyze a stacklog using the interactive webserver:
slowjam --http localhost:8080 /path/to/stack.slog
To output a Gantt/Flamegraph chart to out.html:
slowjam --html out.html /path/to/stack.slog
To output a text summary to out.txt:
slowjam --html out.txt /path/to/stack.slog
Here's an example PR to integrate SlowJam analysis into minikube: minikube#8329.
With this PR, anyone can generate a slowjam profile:
env STACKLOG_PATH=minikube.slog minikube start
You can then convert the data to various forms, as per the examples/ directory:
slowjam --goroutines 1 --pprof example/minikube.pprof example/minikube.slog
slowjam --html example/minikube.html example/minikube.slog
What minikube contributors discovered with these results were:
The net result was a 2.5X reduction in start-up latency: from ~66 seconds to ~26 seconds.
Here's an pod config to analyze a Go binary running on a Kubernetes cluster: Pod SlowJam Profile
In this Pod Config,
STACKLOG_PATH to to generate slowjam profile.pre-stop.HTML
85.5%
Go
14.5%
SlowJam: latency profiler for Go programs
253
stars
82
commits
HTML
primary language
Aug 13, 2026
updated

NOTE: This is not an officially supported Google product
SlowJam is a two-part tool for analyzing function latency within Go programs.
stacklog - a library for sampling the stack of a Go program during runtimeslowjam - a binary for visualizing the latency from recorded stack samplesSlowJam excels at finding optimization opportunities in automation workflows, as they tend to block on command-line execution or remote resources, rather than CPU resources. This tool was created from a hackathon hosted by Google's Container DevEx team, with the goal of finding ways to reduce the start-up latency within minikube.

See example/minikube.html for example output.
Add this to the main() method of your program, or within any other function you wish to record stack samples for:
s := stacklog.MustStartFromEnv("STACKLOG_PATH")
defer s.Stop()
This will invoke the stack sampler if the STACKLOG_PATH environment is set, and will write the stack samples to that location. If you prefer greater control over the configuration, you can also use:
cfg := stacklog.Config{
Path: "out.slog",
Poll: 100 * time.Millisecond,
Quiet: true
}
s, err := stacklog.Start(cfg)
defer s.Stop()
By default, this will poll the stack every 125ms.
Install slowjam:
go install github.com/google/slowjam/cmd/slowjam@latest
Analyze a stacklog using the interactive webserver:
slowjam --http localhost:8080 /path/to/stack.slog
To output a Gantt/Flamegraph chart to out.html:
slowjam --html out.html /path/to/stack.slog
To output a text summary to out.txt:
slowjam --html out.txt /path/to/stack.slog
Here's an example PR to integrate SlowJam analysis into minikube: minikube#8329.
With this PR, anyone can generate a slowjam profile:
env STACKLOG_PATH=minikube.slog minikube start
You can then convert the data to various forms, as per the examples/ directory:
slowjam --goroutines 1 --pprof example/minikube.pprof example/minikube.slog
slowjam --html example/minikube.html example/minikube.slog
What minikube contributors discovered with these results were:
The net result was a 2.5X reduction in start-up latency: from ~66 seconds to ~26 seconds.
Here's an pod config to analyze a Go binary running on a Kubernetes cluster: Pod SlowJam Profile
In this Pod Config,
STACKLOG_PATH to to generate slowjam profile.pre-stop.HTML
85.5%
Go
14.5%