Crates.io | cargo-profile |
lib.rs | cargo-profile |
version | 0.2.1 |
source | src |
created_at | 2020-11-28 08:44:17.347986 |
updated_at | 2021-12-21 07:03:18.425514 |
description | Cargo subcommand to profile performance |
homepage | |
repository | https://github.com/kdy1/cargo-profile.git |
max_upload_size | |
id | 317386 |
size | 87,631 |
Profiling rust program made easy.
cargo install cargo-profile
Supported os: mac os
.
Fork of https://github.com/cmyr/cargo-instruments, but uses cargo
cli for compilation to avoid removing cache.
cargo profile instruments -t time bench --bench parser
Supported os: linux
, mac os
.
# Just use cargo's syntax
cargo profile flamegraph bench --lib
# If you have a my_bench in benches directory, you can do
cargo profile flamegraph bench --bench my_bench
Binaries built by cargo have some random strings as a suffix, and it makes invoking files generated by cargo harder.
Here comes cargo profile bin-path
to aid it.
perf record `cargo profile bin-path bench --bench fixture`
You can get cpu time usage per function on mac os using the command below.
(For linux, you can use perf directly, although I'll add linux aupport soon.)
cargo profile cpu per-fn bench --bench fixture
Note: It does not support dtrace
and perf
yet. Same as above, I'll implement it if there's a need.
xctrace
is a tool to profile applications on
cargo profile trace xctrace bench --lib
cargo profile trace xctrace bench --bench my_bench
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.