Skip to content

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:

  1. build/install samply
  2. Linux: provide necessary perf_ kernel parameters
  3. create a profiling profile (debug symbols in release mode)
[profile.profiling]
inherits = "release"
debug = true
  1. cargo build --profile profiling myapp
  2. samply record ./target/profiling/myapp
  3. wait for myapp to run code you wish to profile, then terminate it
  4. samply load profile.json (automatic on termination)