Improve perf measurements of build_extern_trait_impl
Before, it was only measuring one callsite of `build_impl`, and it incremented the call count even if `build_impl` returned early because the `did` was already inlined. Now, it measures all calls, minus calls that return early.
This commit is contained in:
parent
4e0d3973fa
commit
eb713d272c
@ -335,6 +335,8 @@ fn merge_attrs(
|
||||
return;
|
||||
}
|
||||
|
||||
let _prof_timer = cx.tcx.sess.prof.generic_activity("build_extern_trait_impl");
|
||||
|
||||
let tcx = cx.tcx;
|
||||
let associated_trait = tcx.impl_trait_ref(did);
|
||||
|
||||
|
@ -31,9 +31,7 @@
|
||||
|
||||
for &cnum in cx.tcx.crates(()).iter() {
|
||||
for &(did, _) in cx.tcx.all_trait_implementations(cnum).iter() {
|
||||
cx.tcx.sess.prof.generic_activity("build_extern_trait_impl").run(|| {
|
||||
inline::build_impl(cx, None, did, None, &mut new_items);
|
||||
});
|
||||
inline::build_impl(cx, None, did, None, &mut new_items);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user