An open API service indexing awesome lists of open source software.

https://github.com/younghakim7/profiling_code_in_rust


https://github.com/younghakim7/profiling_code_in_rust

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# Profiling_code_in_Rust
- https://github.com/flamegraph-rs/flamegraph

- Install it, and run

```bash
# Rust projects
cargo flamegraph

# Arbitrary binaries
flamegraph -- /path/to/binary
```

# How to interpret a flamegraph?
- https://www.reddit.com/r/rust/comments/wf9mbn/how_to_interpret_a_flamegraph/?rdt=61382

# C++로 만든 hotspot
https://github.com/KDAB/hotspot


# (221220)Profiling Code in Rust - by Vitaly Bragilevsky - Rust Linz, December 2022 | Rust
- https://youtu.be/JRMOIE_wAFk?si=Ngl2T0FWl74H8v_5
- 동영상내용 github 코드(https://github.com/bravit/generate_parentheses)

# Rust Profiling 도구 종류
- https://nnethercote.github.io/perf-book/profiling.html

|||
|-|-|
|perf||
|gprof||
|callgrind /
cachegrind||
|DTrace||
|Other||

# Profilers(Rust)
- https://nnethercote.github.io/perf-book/profiling.html
- There are many different profilers available, each with their strengths and weaknesses. The following is an incomplete list of profilers that have been used successfully on Rust programs.


  • perf is a general-purpose profiler that uses hardware performance counters.
    Hotspot and Firefox Profiler are good for viewing data recorded by perf.
    It works on Linux.


  • Instruments is a general-purpose profiler that comes with Xcode on macOS.


  • Intel VTune Profiler is a general-purpose profiler. It works on Windows,
    Linux, and macOS.


  • AMD μProf is a general-purpose profiler. It works on Windows and Linux.


  • samply is a sampling profiler that produces profiles that can be viewed
    in the Firefox Profiler. It works on Mac and Linux.


  • flamegraph is a Cargo command that uses perf/DTrace to profile your
    code and then displays the results in a flame graph. It works on Linux and
    all platforms that support DTrace (macOS, FreeBSD, NetBSD, and possibly
    Windows).


  • Cachegrind & Callgrind give global, per-function, and per-source-line
    instruction counts and simulated cache and branch prediction data. They work
    on Linux and some other Unixes.


  • DHAT is good for finding which parts of the code are causing a lot of
    allocations, and for giving insight into peak memory usage. It can also be
    used to identify hot calls to memcpy. It works on Linux and some other
    Unixes. dhat-rs is an experimental alternative that is a little less
    powerful and requires minor changes to your Rust program, but works on all
    platforms.


  • heaptrack and bytehound are heap profiling tools. They work on Linux.


  • counts supports ad hoc profiling, which combines the use of eprintln!
    statement with frequency-based post-processing, which is good for getting
    domain-specific insights into parts of your code. It works on all platforms.


  • Coz performs causal profiling to measure optimization potential, and has
    Rust support via coz-rs. It works on Linux.