Rust Profiling Without the Guesswork: Meet hotpath-rs
You've got a Rust service that's slower than it should be, and you're not sure why. Is it the database calls? The compression? That one function you wrote at 2am? Figuring this out usually means stitching together a handful of tools and hoping they agree with each other. hotpath-rs is a performance profiler for Rust that tries to answer those questions in one place—time, CPU, memory, and async data flow, all from a single instrumented setup.
What It Does
hotpath-rs is an easy-to-configure Rust performance profiler that shows where your code spends time, burns CPU, and allocates memory. The stated goal is helping you tell the difference between functions that are slow because they're waiting on I/O and functions that are actually CPU-intensive—a distinction that matters a lot when you're deciding what to optimize.
You instrument the things you care about: functions, channels, futures, streams, SQL queries, HTTP calls, and byte-level I/O. From there you can either produce one-off reports (timing, memory, or CPU) or watch a live TUI dashboard with real-time metrics and debug info. There's built-in support for Prometheus metrics and Grafana dashboards, so the profiling data can flow into infrastructure you may already have. It's feature-gated, which means zero cost when disabled. The project also ships an MCP server for AI agents and CI regression detection for benchmarking every PR.
Why It's Cool
-
It covers the async and I/O story, not just CPU time. Most profilers will happily tell you a function took 400ms. hotpath-rs will tell you whether that was time spent waiting or time spent computing, and it does the same for channels (throughput, send-to-receive latency, max queue depth) and I/O streams (bytes, transfer rate, average and P95 latency). That's the kind of context you actually need to make a decision.
-
SQL and HTTP get source attribution. The SQL profiling report shows per-query call counts, average and P95 execution time, and—this is the useful part—which source function issued the query. Same idea for HTTP calls with reqwest and ureq, and per-route metrics for axum servers. If you've ever stared at a slow query log wondering where in your codebase it came from, you get why this matters.
-
The setup story is refreshingly low-friction. There's an SSH demo you can try with no installation at all (
ssh demo.hotpath.rs), and the recommended setup path is to let an AI coding agent do the wiring for you. You install thehotpathCLI and runhotpath init --agent claude(or codex, or opencode), and it downloads an agent skill and starts an interactive session to configure profiling in your repo. It's an unusual approach, but it acknowledges that instrumenting a codebase is tedious and error-prone. -
Breadth without obvious bloat. Beyond the obvious timing and allocation tracking, you get concurrency metrics (Mutex/RwLock wait time and contention), Tokio runtime monitoring (workers, scheduling, queues), and HTTP server profiling. These are the things that quietly ruin performance in async Rust, and having them alongside your function-level data saves you from correlating three separate tools.
-
The zero-cost-when-disabled claim is worth noting. Because everything is feature-gated, you can leave the instrumentation in your code and compile it out for production. That's a much nicer workflow than maintaining a separate profiling branch.
How to Try It
The fastest way to see what it looks like is the hosted demo—no install, no clone:
ssh demo.hotpath.rs
To set it up in your own project, install the CLI and let an agent handle the configuration:
cargo install hotpath --version '^0.27'
hotpath init --agent claude # or --agent codex / --agent opencode
From there, you can generate one-off reports for timing, memory, or CPU, or run the live TUI dashboard to watch real-time metrics and async data flow. Prometheus and Grafana integration is available if you want the metrics in your existing dashboards.
The full documentation lives at hotpath.rs, and the source is at github.com/pawurb/hotpath-rs. If you want to contribute, the repo has a CONTRIBUTING.md with development setup guidelines.
Final Thoughts
hotpath-rs is aimed at Rust developers working on services where performance is a real concern—particularly those dealing with async code, database queries, and network I/O, where "slow" can mean several very different things. The AI-assisted setup won't appeal to everyone, and if you prefer to wire up instrumentation by hand, you can absolutely do that. What makes this worth a look is the combination of async observability, I/O and query attribution, and the option to export everything to Prometheus. If you've been profiling Rust with a patchwork of tools, this is a solid candidate for consolidating that workflow.