Skip to content
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

Filter param-env predicates for errors before calling to_opt_poly_trait_pred #107101

Merged
merged 1 commit into from
Jan 23, 2023

Conversation

compiler-errors
Copy link
Member

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 20, 2023
@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 20, 2023
@bors
Copy link
Contributor

bors commented Jan 20, 2023

⌛ Trying commit 096f454 with merge 808366dea853cb6250e002068574f2a512167f30...

@compiler-errors
Copy link
Member Author

If this doesn't work then I'll revert 83fbc71.

@bors
Copy link
Contributor

bors commented Jan 20, 2023

☀️ Try build successful - checks-actions
Build commit: 808366dea853cb6250e002068574f2a512167f30 (808366dea853cb6250e002068574f2a512167f30)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (808366dea853cb6250e002068574f2a512167f30): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking 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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
-0.7% [-0.8%, -0.7%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.7% [-0.8%, -0.7%] 6

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.1% [3.1%, 3.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-3.4%, -1.6%] 2
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 20, 2023
@compiler-errors compiler-errors marked this pull request as ready for review January 20, 2023 18:15
@compiler-errors
Copy link
Member Author

Well it looks like we got back the perf regression on diesel completely with this change. The secondary regression I'm tempted to say is noise.

r? compiler

Comment on lines +177 to +178
.filter(|p| !p.references_error())
.filter_map(|p| p.to_opt_poly_trait_pred());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason this is faster is because Predicates cache their type flags, whereas PolyTraitPredicates do not. So gathering the type flags for a poly trait predicate is O(# of substs) and gathering the type flags for a predicate is O(1).

@compiler-errors compiler-errors changed the title Filter predicates first for fast-path type flags Filter param-env predicates for errors before calling to_opt_poly_trait_ref Jan 22, 2023
@compiler-errors compiler-errors changed the title Filter param-env predicates for errors before calling to_opt_poly_trait_ref Filter param-env predicates for errors before calling to_opt_poly_trait_pred Jan 22, 2023
@petrochenkov
Copy link
Contributor

@bors r+ rollup
(This specific perf change would be easily visible in a rollup.)

@bors
Copy link
Contributor

bors commented Jan 23, 2023

📌 Commit 096f454 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 23, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 23, 2023
Rollup of 7 pull requests

Successful merges:

 - rust-lang#106796 (BPF: Disable atomic CAS)
 - rust-lang#106886 (Make stage2 rustdoc and proc-macro-srv disableable in x.py install)
 - rust-lang#107101 (Filter param-env predicates for errors before calling `to_opt_poly_trait_pred`)
 - rust-lang#107109 (ThinBox: Add intra-doc-links for Metadata)
 - rust-lang#107148 (remove error code from `E0789`, add UI test/docs)
 - rust-lang#107151 (Instantiate dominators algorithm only once)
 - rust-lang#107153 (Consistently use dominates instead of is_dominated_by)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1702349 into rust-lang:master Jan 23, 2023
@rustbot rustbot added this to the 1.69.0 milestone Jan 23, 2023
@compiler-errors compiler-errors deleted the perf-106309-1 branch August 11, 2023 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants