bheisler / iai

Experimental one-shot benchmarking/profiling harness for Rust
Apache License 2.0
586 stars 24 forks source link

Use Callgrind instead of Cachegrind #26

Open madsmtm opened 2 years ago

madsmtm commented 2 years ago

Quick draft, willing to put the work in to making this PR prettier if this transition desired, @bheisler?

Using Callgrind makes the output even more stable, since we no longer need to do an initial calibration run, so any setup that the OS linker has to perform is never included in the output. This is especially important when using valgrind on macOS (see https://github.com/bheisler/iai/issues/25#issuecomment-1029462079), since the linker does more work at runtime there.

See Callgrind docs for more info.

Could also be part of fixing https://github.com/bheisler/iai/issues/7, https://github.com/bheisler/iai/issues/20 and https://github.com/bheisler/iai/issues/23.

madsmtm commented 2 years ago

Idea: Use the callgrind crate or similar to send "client requests" to Valgrind instead of the blunt --toggle-collect that this PR uses now.