Deduplicate target and host filesearch - #160451
Conversation
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Deduplicate target and host filesearch
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (781ece7): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -1.8%, secondary -1.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.3%, secondary 5.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 491.018s -> 489.298s (-0.35%) |
| Arc::new(SearchPath::from_sysroot_and_triple(sopts.sysroot.path(), target_triple)) | ||
| }; | ||
| let host_tlib_path = SearchPath::from_sysroot_and_triple(sopts.sysroot.path(), host_triple); | ||
| let target_tlib_path = SearchPath::from_sysroot_and_triple(sopts.sysroot.path(), target_triple); |
There was a problem hiding this comment.
Nit: cloning SearchPath is still cheaper than calling SearchPath::from_sysroot_and_triple for the second time, even without the Arc, but the benefit may be so small that it doesn't matter.
I'll leave it to you whether to restore this optimization or not.
There was a problem hiding this comment.
I checked what it does and it seems to be very little work, so I think that complicating it with an Arc no longer makes sense.
There was a problem hiding this comment.
(I meant without adding an Arc, literally let host_tlib_path = target_tlib_path.clone().)
There was a problem hiding this comment.
Ah, right. Well, it would still need the check for host == target, I don't think it's needed here.
|
r=me after addressing or not addressing #160451 (comment). |
|
I think it's not worth it to use @bors r=petrochenkov rollup=iffy Setting to iffy because of how our current PR queue looks like. |
…uwer Rollup of 10 perf-sensitive pull requests Successful merges: - #157281 (perf: skip irrelevant foreign impls when building the specialization graph) - #159403 (Next steps for FnDef binder changes (instantiate most FnDef binders)) - #159763 (Optimize crate resolution for large workspace) - #160033 (Speed up `EverInitializedPlaces`) - #160268 (perf: store the fulfillment engine inline in ObligationCtxt) - #160317 (perf: Cache already-checked types in the privacy visitor) - #160399 (interpret: skip deref-projection validity checks when they are not needed) - #160451 (Deduplicate target and host filesearch) - #160453 (Add fast path to `escape_string_symbol`) - #160454 (Add offload guard flags to typeck to prevent perf regressions)
Rollup merge of #160451 - Kobzol:lookup-opt, r=petrochenkov Deduplicate target and host filesearch I was looking into preprocessing the search directories somehow, so that both host and target don't have to scan them. However, it would be a bit annoying, because they don't share the tlib path. But then I noticed that the code already used `Arc` for `SearchPath`, which was essentially the same optimization, which made sense before #158823. But after that PR, it doesn't make sense to put `SearchPath` into `Arc`, because it doesn't really do anything, and the complex logic moved into `FileSearch`. So this PR puts that under `Arc`, to avoid doing duplicated work in the common case, where `host == target`. r? petrochenkov
|
Verifying that actual perf results after merge match expected results |
This comment has been minimized.
This comment has been minimized.
…uwer Rollup of 10 perf-sensitive pull requests Successful merges: - rust-lang/rust#157281 (perf: skip irrelevant foreign impls when building the specialization graph) - rust-lang/rust#159403 (Next steps for FnDef binder changes (instantiate most FnDef binders)) - rust-lang/rust#159763 (Optimize crate resolution for large workspace) - rust-lang/rust#160033 (Speed up `EverInitializedPlaces`) - rust-lang/rust#160268 (perf: store the fulfillment engine inline in ObligationCtxt) - rust-lang/rust#160317 (perf: Cache already-checked types in the privacy visitor) - rust-lang/rust#160399 (interpret: skip deref-projection validity checks when they are not needed) - rust-lang/rust#160451 (Deduplicate target and host filesearch) - rust-lang/rust#160453 (Add fast path to `escape_string_symbol`) - rust-lang/rust#160454 (Add offload guard flags to typeck to prevent perf regressions)
|
Finished benchmarking commit (68be5aa): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.5%, secondary -0.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 0.1%, secondary -0.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 489.577s -> 490.03s (0.09%) |
I was looking into preprocessing the search directories somehow, so that both host and target don't have to scan them. However, it would be a bit annoying, because they don't share the tlib path. But then I noticed that the code already used
ArcforSearchPath, which was essentially the same optimization, which made sense before #158823. But after that PR, it doesn't make sense to putSearchPathintoArc, because it doesn't really do anything, and the complex logic moved intoFileSearch. So this PR puts that underArc, to avoid doing duplicated work in the common case, wherehost == target.r? petrochenkov