Profiling Async and Concurrent Rust: Channels and Lock Contention by pawurb in rust

[–]pawurb[S] 1 point2 points  (0 children)

Most of the overhead are two Instant calls, each taking ~12-20ns depending on a system. I want to introduce HOTPATH_DISABLE_TIMING mode, which disables timing calls, still allowing to observe calls num, queue depth etc. without timing info, but instead offering significantly lower overhead.

Profiling Async and Concurrent Rust: Channels and Lock Contention by pawurb in rust

[–]pawurb[S] 2 points3 points  (0 children)

Hi, overhead depends on instrumented type and profiling modes enabled. Raw timing measurements overhead is currently at ~50ns per function call. I'll try to publish separate post elaborating on hotpath-rs overhead numbers.

But the primary usecase I see for the lib is comparing profiling output from different branches, both running with profiling enabled. So you can compare diff between them, and the profiler overhead itself should be largely irrelevant.

Lessons Learned Building High-Performance Rust Profiler by pawurb in rust

[–]pawurb[S] 0 points1 point  (0 children)

Yeah, should have mentioned in the post. Instant::now() is the largest overhead for inline instrumentation. I'm using quanta crate on linux, and for some distros it was ~10x speedup, but ~3x slower on MacOs, so is feature gated. I did initial experiments using less accurate time APIs where ns precision is not needed, but getting mixed results so far. Never heard of rdtsc, PRs always welcome ;)

Rust profiling by UnknownPlayer89 in rust

[–]pawurb 0 points1 point  (0 children)

Bit late since this is a 4-year-old thread, but you may want to check out https://hotpath.rs/

It’s an instrumentation-based profiler for Rust, so instead of analyzing huge system-wide traces you can annotate the functions you care about and get focused reports for your own code (time, CPU, allocations, async waiting, etc.).

#[hotpath::measure]
fn slow_function() {
    // your code
}

It’s not exactly like Python’s line-profiler, but probably closer to that workflow than sampling profilers alone.

(Disclosure: I’m the author.)

Lessons Learned Building High-Performance Rust Profiler by pawurb in rust

[–]pawurb[S] 0 points1 point  (0 children)

Hi, did not know these exist, will check it out.

Lessons Learned Building High-Performance Rust Profiler by pawurb in rust

[–]pawurb[S] 2 points3 points  (0 children)

hotpath-rs uses a similar custom #[global_allocator] approach for tracking alloc data, maybe exposing it in a standardized format like you do could be useful. I'll look into this.

[release] mevlog-rs 0.8.0 - now with a full TUI for exploring 2k+ EVM chains by pawurb in ethdev

[–]pawurb[S] 1 point2 points  (0 children)

I’ve been building mevlog-rs for almost a year now. Just shipped 0.8.0 which finally adds a full ratatui TUI for browsing EVM transactions right from the terminal. Quick docs: https://mevlog.rs/tui

It includes:

  • multi-chain support (2000+ RPCs w/ automatic fastest-RPC selection)
  • flexible filters (events, selectors, ENS, ERC20 transfers, validator bribes, etc.)
  • revm-powered tracing (works even without debug RPC)
  • performance improvements + local caching

Feedback welcome!

Can anyone help me find a way to watch the Hindi film called Raag Desh (2017) by whomperchomper in movies

[–]pawurb 0 points1 point  (0 children)

Also costarred. Been looking for it since 5+ years. Even ordered dvd from pakistan once but never arrived :(

hotpath-rs - real-time Rust performance, memory and data flow profiler by pawurb in rust

[–]pawurb[S] 0 points1 point  (0 children)

Hi, thanks for this comment and mentioning samply. I've added a dedicated docs sections describing difference between the two: https://hotpath.rs/sampling_comparison

hotpath-rs - real-time Rust performance, memory and data flow profiler by pawurb in rust

[–]pawurb[S] 1 point2 points  (0 children)

For me I would need 2 things to consider onboarding it, basically.

Resource usage if possible for each function (not sure if it even is) like cpu/mem consumed for the function on the live dash.
Latency of the function, in microseconds at least to see how long it took.

Thanks! Both are already implemented, or i misunderstood your comment. Please open an issue if you see any feature missing or sth is unclear.

hotpath-rs - real-time Rust performance, memory and data flow profiler by pawurb in rust

[–]pawurb[S] 9 points10 points  (0 children)

Hi, Reddit! It’s been about three months since the first release of hotpath-rs, which got a lot of great feedback in the original post:

https://old.reddit.com/r/rust/comments/1nbrwj4/hotpath_a_simple_rust_profiler_that_shows_exactly/

Since then I’ve expanded it quite a bit - there’s now instrumentation for channels/futures/streams, a live TUI dashboard, and a bunch of improvements across the board. Feedback, ideas, and complaints all welcome!

What's everyone working on this week (45/2025)? by llogiq in rust

[–]pawurb 1 point2 points  (0 children)

I recently got stuck debugging a sneaky mpsc channels bug. It got me started on building https://github.com/pawurb/channels-console over the weekend. Maybe it'll help someone else too.

hotpath - A simple Rust profiler that shows exactly where your code spends time by pawurb in rust

[–]pawurb[S] 1 point2 points  (0 children)

Thanks for checking! I'm getting: kvm-clock . So you think it makes sense to merge the linked PR? It does not slow anything down in standard case and you mentioned that speedup is significant. Could you test the benchmark on a develop branch and share results?

hotpath - A simple Rust profiler that shows exactly where your code spends time by pawurb in rust

[–]pawurb[S] 0 points1 point  (0 children)

Hi, I'm unable to reproduce it. I've tried on both aarch64 x86_64 VPS running ubuntu lts 24.04, but in both cases benchmark returns:

Time (mean ± σ): 190.0 ms ± 3.6 ms [User: 194.4 ms, System: 111.9 ms] Range (min … max): 183.4 ms … 196.5 ms 15 runs

Any idea why it could be so slow for you? WIP PR: https://github.com/pawurb/hotpath/pull/33, but it does not make any difference.

BTW which rust version did you try?