lean-bench

5.4. Workflow 3 samply🔗

samply is a perf-style sampling profiler that works on Linux and macOS, with a built-in Firefox-Profiler-compatible viewer. Useful when you don't want to deal with perf's output file or you're on macOS.

$ cargo install samply  # one-time
$ lake exe bench profile myFib --param 4096 \
    --profiler "samply record --"

samply record boots a local server and prints a URL; open it in a browser for the interactive flamegraph view.

On macOS, samply is the path of least resistance — Apple's Instruments works too, but its CLI integration is heavier.