# Install `rssh` binary in your CARGO path.
$ cargo install --path .
# Initializes and hardlinks all the mini utility `cmd` binaries to the shell.
$ rssh
# Run any of the commands in the rssh/src/cmd/ directory.
$ <cmd>
Use cargo flamegraph
to build and profile a Rust project by specifying the --build and --profile options.
For example:
cargo flamegraph --build --profile=release --bin <binary_name>
This will compile the project in release mode, profile the specified binary and generate a flamegraph for it. The flamegraph will help you visualize the performance of the program by showing the hotspots in the code, where most of the time is spent.
First, make sure the release build of the program has debugging information enabled by adding the following to the Cargo.toml file:
[profile.release]
debug = true
or set the environment variable:
export CARGO_PROFILE_RELEASE_DEBUG=true
Build the program in release mode:
cargo build --release
Use perf record to capture performance data:
perf record -g --call-graph dwarf target/release/rssh
Use perf report to analyze the performance data:
perf report
This will give a detailed report of the performance of the program and help identify performance bottlenecks.
- Thanks to @matklad with xtools and repository for
rssh
's' "starter".