-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Deduplicate -L search paths #145408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deduplicate -L search paths #145408
Conversation
e17ef7d
to
fd5b737
Compare
let search_paths: Vec<SearchPath> = { | ||
let mut seen_search_paths = FxHashSet::default(); | ||
let search_path_matches: Vec<String> = matches.opt_strs("L"); | ||
search_path_matches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
search_path_matches | |
matches.opt_strs("L") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't work without the local variable, because the filter
passes through references, and they would become dangling if the data wasn't stored on stack.
@bors r+ |
I'll also run a parallel perf. run just to see if there is any effect in the perf. suite (I would say unlikely). @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 -L search paths
This comment has been minimized.
This comment has been minimized.
Rollup of 11 pull requests Successful merges: - #144210 (std: thread: Return error if setting thread stack size fails) - #145310 (Reduce usage of `compiler_for` in bootstrap) - #145311 (ci: clean windows disk space in background) - #145340 (Split codegen backend check step into two and don't run it with `x check compiler`) - #145408 (Deduplicate -L search paths) - #145412 (Windows: Replace `GetThreadId`+`GetCurrentThread` with `GetCurrentThreadId`) - #145413 (bootstrap: Reduce dependencies) - #145426 (Fix typos in bootstrap.example.toml) - #145430 (Fix wrong spans with external macros in the `dropping_copy_types` lint) - #145431 (Enhance UI test output handling for runtime errors) - #145448 (Autolabel `src/tools/{rustfmt,rust-analyzer}` changes with `T-{rustfmt,rust-analyzer}`) r? `@ghost` `@rustbot` modify labels: rollup
Finished benchmarking commit (e175e89): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never 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 6.7%, secondary 3.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -6.7%, secondary -1.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.7%, secondary -0.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 471.246s -> 469.118s (-0.45%) |
Ok clap_derive is noise, but the bootstrap improvements look nice! |
Rollup merge of #145408 - Kobzol:deduplicate-search-paths, r=petrochenkov Deduplicate -L search paths For each -L passed to the compiler, we eagerly scan the whole directory. If it has a lot of files, that results in a lot of allocations. So it's needless to do this if some -L paths are actually duplicated (which can happen e.g. in the situation in the linked issue). This PR both deduplicates the args, and also teaches rustdoc not to pass duplicated args to merged doctests. Fixes: #145375
For each -L passed to the compiler, we eagerly scan the whole directory. If it has a lot of files, that results in a lot of allocations. So it's needless to do this if some -L paths are actually duplicated (which can happen e.g. in the situation in the linked issue).
This PR both deduplicates the args, and also teaches rustdoc not to pass duplicated args to merged doctests.
Fixes: #145375