Quickly find bottlenecks in Rust - one profiler for CPU, memory, SQL, HTTP, I/O and async code.
Quickly find bottlenecks in Rust - one profiler for CPU, memory, SQL, HTTP, I/O and async code.
hotpath-rs is an easy-to-configure Rust performance profiler that shows exactly where your code spends time, burns CPU, and allocates memory.
It helps you distinguish between functions that are slow because they wait on I/O and those that are CPU-intensive. Instrument functions, channels, futures, streams, SQL queries, HTTP calls, and byte-level I/O to find bottlenecks and focus optimizations where they matter most. Get actionable insights into time, memory, and async data flow with minimal setup. Built-in support for Prometheus metrics and Grafana dashboards.
Try the TUI demo via SSH - no installation required:
ssh demo.hotpath.rs
Or let your own AI agent configure profiling in a repo:
cargo install hotpath
hotpath init --agent claude
Explore the full documentation at hotpath.rs. See CONTRIBUTING.md for development setup and guidelines.
You can use it to produce one-off performance (timing, memory or CPU) reports:
inspect throughput and latency of network, file or compression I/O streams:
analyze SQL/HTTP calls performance with automatic source function attribution:
monitor throughput, performance and max queue depth of instrumented channels:
or use the live TUI dashboard to monitor real-time performance and async data flow metrics with debug info:
https://github.com/user-attachments/assets/2e890417-2b43-4b1b-8657-a5ef3b458153
The quickest way to set up hotpath is to let an AI coding agent do it. Install the hotpath CLI and run init inside your project:
cargo install hotpath --version '^0.26'
hotpath init --agent claude # or --agent codex / --agent opencode
hotpath init downloads the hotpath_init agent skill from GitHub and starts an interactive Claude Code, Codex or OpenCode session with it as setup instructions. The agent inspects your project, adds the feature-gated dependency, instruments main and a starting set of functions, channels and locks, then verifies that everything compiles with profiling enabled and disabled. You review and approve each edit through the agent's regular permission prompts. Requires curl and the claude, codex or opencode CLI on PATH.
You can also use the skill directly, without the hotpath CLI: copy it to ~/.claude/skills/hotpath_init/SKILL.md and run /hotpath_init in a Claude Code session.
Add to your Cargo.toml:
[dependencies]
hotpath = "0.26"
[features]
hotpath = ["hotpath/hotpath"]
hotpath-cpu = ["hotpath/hotpath-cpu"]
hotpath-alloc = ["hotpath/hotpath-alloc"]
hotpath-prometheus = ["hotpath/hotpath-prometheus"]
This config ensures that the lib has no compile time or runtime overhead unless explicitly enabled via a hotpath feature. All the lib dependencies are optional (i.e. not compiled) and all macros are noop unless profiling is enabled.
You'll need only #[hotpath::main] and #[hotpath::measure] macros to get started:
…
Now, run your program with hotpath (and optionally hotpath-alloc features):
cargo run --features='hotpath,hotpath-alloc'
On exit it will print a report with timings, memory allocations and thread usage metrics:
…
See the full docs and advanced config tutorials at hotpath.rs.
Read the complete guide to profiling Rust applications - a comprehensive overview of debugging performance issues in Rust.
hotpath vs sampling profilers like perf and samplyMy long-term goal for hotpath-rs is to become the single place to understand all performance signals in a Rust application. From CPU and memory usage to locks, channels, and async execution, all the way up to SQL queries and HTTP/RPC calls.
I'm also building a hosted version that makes profiling reports easier to share, compare, and analyze across pull requests, deployments, and teams.
If that sounds useful, join the waitlist for early access:
This project is under active development. Core public APIs are stable, but implementation details (JSON report formats, TUI/MCP internals, and advanced config options) may change between releases as the project evolves.
No open issues yet, or sync has not completed.