Profiling#
Local CPU Profiling with Samply#
Using samply we can run kube applications to generate cpu profiles for the firefox profiler.
The documentation above is canonical, but here's a tiny TL;DR:
- build/install samply
- Linux: provide necessary perf_ kernel parameters
- create a profiling profile (debug symbols in release mode)
[profile.profiling]
inherits = "release"
debug = true
cargo build --profile profiling myapp
samply record ./target/profiling/myapp
- wait for myapp to run code you wish to profile, then terminate it
samply load profile.json
(automatic on termination)