cmyr / cargo-instruments

A cargo plugin to generate Xcode Instruments trace files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Execute bench targets

michael-p opened this issue · comments

It seems it is not possible to run cargo instruments on a benchmark target (i.e. what gets executed by cargo bench). I think this would be a very useful addition!

A more generic solution might be to make it possible to just pass in a path to an arbitrary executable file.

I investigated benchmarks, and there were some problems. The main issue is that when you compile a benchmark target, the benchmark harness gets compiled in as well, which adds noise to the profile. I didn't dig into this too too much, so it's possible there's an easy solution, but it isn't totally obvious

That's right, however, I'm not sure it's really a problem if the benchmark harness gets profiled as well since the overhead/noise there shouldn't be too high. cargo flamegraph seems to do it that way, see flamegraph-rs/flamegraph#1 and PR flamegraph-rs/flamegraph#29

cool, that does look helpful.