pprof-rs
samply
pprof-rs | samply | |
---|---|---|
5 | 8 | |
1,213 | 1,784 | |
1.7% | - | |
4.2 | 9.4 | |
18 days ago | 3 days ago | |
Rust | Rust | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pprof-rs
-
Help with Rust Program performance
On top of others' specific recommendations, don't forget to profile! Tools like perf on Linux and pprof within Rust will tell you which functions are taking the most time.
-
CPU Profiling in WSL-ish setup
https://github.com/tikv/pprof-rs: Seems to work nicely per se, but I cant seem to find any useful information in the flamegraph for my setting. I see mostly functions in std::thread but cant find the time it costs to render stuff or to do the actual computations which should be the most time consuming things. Not sure whether this is necessarily something wrong with pprof-rs, maybe I'm just bad at finding stuff in the flamegraph svg or bevys ECS is making this hard.
-
Does rust have a visual analysis tool for memory and performance like pprof of golang?
Have you looked into using pprof?
-
Pyroscope Profiler 0.5 released
The library doesn't actually do any profiling (The profiler for Rust is pprof-rs: https://github.com/tikv/pprof-rs) but it's goal is to manage data returned by profilers (abstracted behind a Backend) and send this data to a Pyroscope Server (or exported to flamegraph, though this is being implemented in the commandline application).
-
Rust support for continuous profiling added in Pyroscope v0.10.2
The libunwind part is actually not related to overhead, this is just a nuance of the way that pprof-rs unwinds stack traces.
samply
- Samply: Command-line sampling profiler for macOS and Linux
- samply: Command line CPU profiler which uses the Firefox profiler as its UI
-
Help with Rust Program performance
Regarding profilers, I really like samply. It doesn't require to modify source code, runs on Linux and macOS and automatically loads profiling data into Firefox Profiler UI.
-
AI learns to play flappy bird (code in comments)
I grabbed a quick profile using samply and noticed two things: Even in fast mode, the simulation only updates when the screen is redrawn, so its update frequency is limited by the refresh rate. And the simulation seems to mostly be bottle-necked by Vec reallocation, so re-using Vecs might help.
-
Firefox Profiler
I ran across this when I found samply [0], a CLI sampling profiler. On samply's GitHub there's a link to a sample profile that opens in the Firefox Profiler and I was in awe at just how fast it is! Try dragging your mouse over the timeline for a second: https://share.firefox.dev/3j3PJoK
0: https://github.com/mstange/samply
-
Frame pointers vs. DWARF – my verdict
IMHO, perf's decision to write whole stacks directly to the disk and unwinding them as a post-process is a really bad design. It wastes disk space, and as the author pointed out, it also has a lot of IO overhead.
As an alternative approach, https://github.com/mstange/samply processes data streamed from perf and unwinds it in realtime. The unwinding overhead is surprisingly low: it only takes around 1% of (single) CPU per CPU profiled. Solving the disk waste alone has been a tremendous improvement of profiling experience. As a bonus, the unwinding and symbolization works reliably while I frequently had postprocessing not terminating when using the perf CLI directly.
-
Data-driven performance optimization with Rust and Miri
samply supports showing inline frames in call stacks. I find this makes a huge difference when profiling Rust.
- Samply: A work in progress of a command-line profiler for macOS and Linux
What are some alternatives?
pyroscope - Continuous Profiling Platform. Debug performance issues down to a single line of code
rust-flappy-bird-ai - AI learns to play flappy bird using neuro-evolution, implemented in Rust using macroquad
pyroscope - Continuous Profiling Platform. Debug performance issues down to a single line of code [Moved to: https://github.com/grafana/pyroscope]
flamegraph - Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3
pprof - pprof is a tool for visualization and analysis of profiling data
profiler - Firefox Profiler — Web app for Firefox performance analysis
bytehound - A memory profiler for Linux.
parca-agent - eBPF based always-on profiler auto-discovering targets in Kubernetes and systemd, zero code changes or restarts needed!
pyroscope-rs - Pyroscope Profiler for Rust. Profile your Rust applications.
rayon - Rayon: A data parallelism library for Rust
heaptrack - A heap memory profiler for Linux
perfmon