$git clone https://github.com/pawurb/hotpath-rshotpath-rs is an easy-to-configure Rust performance profiler that shows exactly where your code spends time, burns CPU, and allocates memory.
| 1 | # <img src="media/hotpath-logo2.png" alt="hotpath-rs logo" width="80px" align="left"> hotpath - Rust Performance, CPU & Memory Profiler |
| 2 | [](https://github.com/pawurb/hotpath/actions) [](https://crates.io/crates/hotpath) [](https://crates.io/crates/hotpath) [](https://hotpath.rs/sponsorship) |
| 3 | |
| 4 | hotpath-rs is an easy-to-configure Rust performance profiler that shows exactly where your code spends time, burns CPU, and allocates memory. |
| 5 | |
| 6 | 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, and streams to find bottlenecks and focus optimizations where they matter most. Get actionable insights into time, memory, and async data flow with minimal setup. |
| 7 | |
| 8 | Try the TUI demo via SSH - no installation required: |
| 9 | |
| 10 | ``` |
| 11 | ssh demo.hotpath.rs |
| 12 | ``` |
| 13 | |
| 14 | Or let your own AI agent configure profiling in a repo: |
| 15 | ``` |
| 16 | cargo install hotpath |
| 17 | hotpath init --agent claude |
| 18 | ``` |
| 19 | |
| 20 | Explore the full documentation at [hotpath.rs](https://hotpath.rs). See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines. |
| 21 | |
| 22 | You can use it to produce one-off performance (timing, memory or CPU) reports: |
| 23 | |
| 24 |  |
| 25 | |
| 26 | monitor throughput, performance and max queue depth of instrumented channels: |
| 27 | |
| 28 |  |
| 29 | |
| 30 | analyze SQL calls performance: |
| 31 | |
| 32 |  |
| 33 | |
| 34 | or use the live TUI dashboard to monitor real-time performance metrics with debug info: |
| 35 | |
| 36 | https://github.com/user-attachments/assets/2e890417-2b43-4b1b-8657-a5ef3b458153 |
| 37 | |
| 38 | ## Features |
| 39 | |
| 40 | - **Time, CPU & memory profiling** - identify expensive functions, allocation hotspots, and investigate memory leaks. |
| 41 | - **Async observability** - futures, channels and streams. |
| 42 | - **SQL query profiling** - query performance metrics for sqlx and Diesel. |
| 43 | - **Concurrency metrics** - Mutex/RwLock wait time and contention. |
| 44 | - **Tokio runtime monitoring** - workers, scheduling and queues. |
| 45 | - **Live TUI dashboard & static reports** - real-time or one-off analysis. |
| 46 | - **CI regression detection** - benchmark every PR automatically. |
| 47 | - **MCP server for AI agents** - query profiling data in real time. |
| 48 | - **Zero cost when disabled** - fully feature-gated. |
| 49 | |
| 50 | ## Current roadmap |
| 51 | |
| 52 | - [x] [`hotpath::channel!/stream!/future!` events batching](https://github.com/pawurb/hotpath-rs/issues/345) |
| 53 | - [x] [`hotpath::mutex!/rw_lock!`](https://github.com/pawurb/hotpath-rs/issues/340) |
| 54 | - [x] `hotpath::channel!(..., wrap = true)` |
| 55 | - [x] [`hotpath::channel!` timing histogram](https://github.com/pawurb/hotpath-rs/issues/299) |
| 56 | - [ ] [Instrument AsyncRead/AsyncWrite and Read/Write wrappers](https://github.com/pawurb/hotpath-rs/issues/379) |
| 57 | - [ ] `hotpath::sql!(...)` |
| 58 | - [ ] `hotpath::http!(...)` |
| 59 | |
| 60 | ## Getting Started |
| 61 | |
| 62 | ### AI Setup (Recommended) |
| 63 | |
| 64 | 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: |
| 65 | |
| 66 | ```bash |
| 67 | cargo install hotpath --version '^0.21' |
| 68 | hotpath init --agent claude # or --agent codex |
| 69 | ``` |
| 70 | |
| 71 | `hotpath init` downloads the [hotpath_init agent skill](skills/hotpath_init/SKILL.md) from GitHub and starts an interactive Claude Code or Codex 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 |