samply is a command-line sampling profiler for macOS, Linux, and Windows that uses the Firefox profiler as its user interface.
samply addresses the need for efficient CPU profiling by recording stack traces at a configurable sampling interval, defaulting to 1000Hz. The tool works by prepending `samply record` to any command, spawning the target application as a subprocess and collecting performance data. On macOS and Windows, it captures both on-CPU and off-CPU samples, allowing developers to see blocking behavior in addition to active execution. On Linux, it relies on perf events for on-CPU sampling. Once recording completes, samply automatically opens the Firefox profiler in the default browser, loads the captured profile, and runs a local webserver to serve symbol information and source code, enabling interactive inspection of flame graphs, timelines, and call trees.
Developers should choose samply if they need a lightweight, cross-platform profiler that integrates with an established web-based analysis interface. It suits projects where developers want to avoid heavyweight tools or prefer the Firefox profiler's visualization capabilities. The tool keeps all data local until explicitly uploaded, addressing privacy concerns. For Rust projects, samply works best with binaries compiled in release mode with debug info enabled; similar practices apply to C++ and other compiled languages. The README does not compare samply to alternative profilers.
The project shows active development with regular commits addressing both features and bug fixes. Work spans multiple platforms with platform-specific implementations for Linux perf integration, Windows symbol server support, and macOS-specific sampling mechanisms. The maintainer responds to issues and incorporates user feedback, as evidenced by documented workarounds for known platform-specific challenges such as Linux mlock limits and capability-based access control.