Skip to content

Commit a9f664f

Browse files
committed
Auto merge of rust-lang#90363 - camelid:build-impl-perf, r=jyn514
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.
2 parents df76418 + eb713d2 commit a9f664f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/librustdoc/clean/inline.rs

+2
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ crate fn build_impl(
335335
return;
336336
}
337337

338+
let _prof_timer = cx.tcx.sess.prof.generic_activity("build_extern_trait_impl");
339+
338340
let tcx = cx.tcx;
339341
let associated_trait = tcx.impl_trait_ref(did);
340342

src/librustdoc/passes/collect_trait_impls.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ crate fn collect_trait_impls(krate: Crate, cx: &mut DocContext<'_>) -> Crate {
3131

3232
for &cnum in cx.tcx.crates(()).iter() {
3333
for &(did, _) in cx.tcx.all_trait_implementations(cnum).iter() {
34-
cx.tcx.sess.prof.generic_activity("build_extern_trait_impl").run(|| {
35-
inline::build_impl(cx, None, did, None, &mut new_items);
36-
});
34+
inline::build_impl(cx, None, did, None, &mut new_items);
3735
}
3836
}
3937

0 commit comments

Comments
 (0)