-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Remove unnecessary sorts in rustc_hir_analysis
#131328
Remove unnecessary sorts in rustc_hir_analysis
#131328
Conversation
This is an attempt to gain the performance loss after the PR rust-lang#131140. Here the related objects are `IndexSet` so do not require a sort to stay stable.
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.
ill approve when ci is green
You are very fast: #131140 (comment) |
let mut impl_blocks = | ||
region.impl_blocks.into_iter().collect::<SmallVec<[usize; 8]>>(); | ||
impl_blocks.sort_unstable(); | ||
let impl_blocks = region.impl_blocks.into_iter().collect::<SmallVec<[usize; 8]>>(); |
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.
That into_iter().collect()
can actually be skipped?
No, there is nested for
:-(
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 might be possible to use the IndexSet::as_slice
API
@bors r+ |
…rts-in-rustc-hir-analysis, r=compiler-errors Remove unnecessary sorts in `rustc_hir_analysis` A follow-up after rust-lang#131140. Here the related objects are `IndexSet` so do not require a sort to stay stable. And they don't need to be `mut` anymore. r? `@compiler-errors`
…rts-in-rustc-hir-analysis, r=compiler-errors Remove unnecessary sorts in `rustc_hir_analysis` A follow-up after rust-lang#131140. Here the related objects are `IndexSet` so do not require a sort to stay stable. And they don't need to be `mut` anymore. r? ``@compiler-errors``
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#122670 (Fix bug where `option_env!` would return `None` when env var is present but not valid Unicode) - rust-lang#130568 (Make some float methods unstable `const fn`) - rust-lang#131137 (Add 1.82 release notes) - rust-lang#131328 (Remove unnecessary sorts in `rustc_hir_analysis`) - rust-lang#131652 (Move polarity into `PolyTraitRef` rather than storing it on the side) - rust-lang#131675 (Update lint message for ABI not supported) - rust-lang#131681 (Fix up-to-date checking for run-make tests) - rust-lang#131703 (Resolved python deprecation warning in publish_toolstate.py) - rust-lang#131706 (Fix two const-hacks) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#130608 (Implemented `FromStr` for `CString` and `TryFrom<CString>` for `String`) - rust-lang#130635 (Add `&pin (mut|const) T` type position sugar) - rust-lang#130747 (improve error messages for `C-cmse-nonsecure-entry` functions) - rust-lang#131137 (Add 1.82 release notes) - rust-lang#131328 (Remove unnecessary sorts in `rustc_hir_analysis`) - rust-lang#131496 (Stabilise `const_make_ascii`.) - rust-lang#131706 (Fix two const-hacks) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#131328 - ismailarilik:remove-unnecessary-sorts-in-rustc-hir-analysis, r=compiler-errors Remove unnecessary sorts in `rustc_hir_analysis` A follow-up after rust-lang#131140. Here the related objects are `IndexSet` so do not require a sort to stay stable. And they don't need to be `mut` anymore. r? ```@compiler-errors```
A follow-up after #131140. Here the related objects are
IndexSet
so do not require a sort to stay stable. And they don't need to bemut
anymore.r? @compiler-errors