Stream: t-compiler/wg-self-profile

Topic: measuring time spent in traits code


nikomatsakis (May 07 2019 at 17:57, on Zulip):

I'm curious -- suppose I wanted to measure the amount of time that we spend doing trait solving. I used to use perf for this but I've found that its backtraces have become super unreliable. Could I extend the self-profile to help me get this information?

nikomatsakis (May 07 2019 at 17:57, on Zulip):

e.g., by adding hooks at various spots in the code?

Wesley Wiser (May 07 2019 at 18:01, on Zulip):

Absolutely!

Wesley Wiser (May 07 2019 at 18:01, on Zulip):

If the trait solving is done in a query, then we're already tracking that time under the query

Wesley Wiser (May 07 2019 at 18:03, on Zulip):

Otherwise, you can use the SelfProfiler::start_activity() and SelfProfiler::end_activity() methods like we do here https://github.com/rust-lang/rust/blob/767f59462663fbc55a69d39fc5e1f7f83b6fb37d/src/librustc_codegen_llvm/lib.rs#L331-L345

nikomatsakis (May 07 2019 at 18:18, on Zulip):

thanks @Wesley Wiser

nikomatsakis (May 07 2019 at 20:25, on Zulip):

I gave this a try and I'm getting data anyway :)

mw (May 08 2019 at 08:00, on Zulip):

Yeah, I think we should add some extra probes for trait code

Last update: Nov 15 2019 at 20:05UTC