-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Simplify duplicate checks for mir validator #111917
Conversation
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
r? @oli-obk |
self.place_cache.push(place.as_ref()); | ||
has_duplicates |= !self.place_cache.insert(place.as_ref()); |
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.
Here can just break from for
when dupe found, but given that this is error only code path, probably doesn't matter.
I'm assuming a But I don't think this is gonna cause perf issues either way (tho maybe check whether the original PR that added the code had any discussion on this) |
@oli-obk I'm not sure how
|
it does at small sizes 😆 the hashset only pays off after a certain number of entries. |
@bors try @rust-timer queue |
@bors r+ |
This comment has been minimized.
This comment has been minimized.
⌛ Testing commit cdaef2c with merge e96399e9a856d9600fea2b1e8af8708c246a9e39... |
☀️ Try build successful - checks-actions |
1 similar comment
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
@bors r=oli-obk |
Finished benchmarking commit (e96399e9a856d9600fea2b1e8af8708c246a9e39): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 656.625s -> 658.283s (0.25%) |
@bors r+ rollup |
💡 This pull request was already approved, no need to approve it again.
|
…li-obk Simplify duplicate checks for mir validator This removes unnecessary allocations & is less code.
…mpiler-errors Rollup of 8 pull requests Successful merges: - rust-lang#111917 (Simplify duplicate checks for mir validator) - rust-lang#112008 (Fix incorrect documented default bufsize in bufreader/writer) - rust-lang#112825 (Don't call `type_of` on TAIT in defining scope in new solver) - rust-lang#113164 (Add a regression test for rust-lang#109054) - rust-lang#113318 (Revert "alloc: Allow comparing Boxs over different allocators", add regression test) - rust-lang#113397 (Prefer object candidates in new selection) - rust-lang#113419 (Avoid calling item_name for RPITIT) - rust-lang#113421 (Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys) r? `@ghost` `@rustbot` modify labels: rollup
This removes unnecessary allocations & is less code.