cargo-profiler
cargo-profiler copied to clipboard
Doc Improvements
Answering these questions will probably just need doc improvements rather than other fixes, but I'm not sure so here goes:
- Using
cargo profiler callgrind
which executable is run? - How does this work with
cargo bench
? Can I runcargo profiler --bench callgrind
(or something like that) to get profile stats for the different benchmarks? For now I've been creating amain.rs
building that (with debug symbols) and then usingcargo profiler callgrind -n 20 --bin ./target/release/executable_name
. I swap out the contents of main with my benchmarks to get results. This seems suboptimal. I'm probably missing something. - It's probably worth calling out specifically that
-n <count>
limits the shown instructions. That wasn't immediately clear.
Thanks.
The profiled binary comes from the build
command.
Normally, rust benchmarks are separate binaries running with or without the --bench
flag. This means, at least for now, you can profile benchmarks using the --bin
flag (optionally with command line arguments via --
)