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

Remove some eval_always #86056

Closed
wants to merge 4 commits into from
Closed

Remove some eval_always #86056

wants to merge 4 commits into from

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Jun 6, 2021

Some eval_always marker may not be useful and trigger unnecessary query recomputations. This PR attempts to measure the amount of such recomputations.

Blocked on #90581

@cjgillot
Copy link
Contributor Author

cjgillot commented Jun 6, 2021

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

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

bors commented Jun 6, 2021

⌛ Trying commit eaafd8ead4d98f3d149f5cd0c09571b683150c98 with merge 8d3ac8e1689d1b87817fc925bd2897fa410c6079...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jun 6, 2021

☀️ Try build successful - checks-actions
Build commit: 8d3ac8e1689d1b87817fc925bd2897fa410c6079 (8d3ac8e1689d1b87817fc925bd2897fa410c6079)

@rust-timer
Copy link
Collaborator

Queued 8d3ac8e1689d1b87817fc925bd2897fa410c6079 with parent 3740ba2, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (8d3ac8e1689d1b87817fc925bd2897fa410c6079): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 6, 2021
@jyn514
Copy link
Member

jyn514 commented Jun 6, 2021

@cjgillot the biggest slowdown I saw was from privacy_access_levels - I wonder if that map is being hashed now when it wasn't before? If you add no_hash, does it speed things up?

@jyn514
Copy link
Member

jyn514 commented Jun 6, 2021

Also, I'd be curious to see the perf impact of just the first commit, using that for rust-lang/compiler-team#437 would make things a lot easier I think.

@cjgillot
Copy link
Contributor Author

cjgillot commented Jun 6, 2021

The first commit is #85941

@cjgillot
Copy link
Contributor Author

cjgillot commented Jul 4, 2021

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

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

bors commented Jul 4, 2021

⌛ Trying commit 52cae872b76456e98d0f279ce81d2dde50ee95e9 with merge 0b514f420336f0083b2363744ce7bdcdced7283f...

@bors
Copy link
Contributor

bors commented Jul 4, 2021

☀️ Try build successful - checks-actions
Build commit: 0b514f420336f0083b2363744ce7bdcdced7283f (0b514f420336f0083b2363744ce7bdcdced7283f)

@rust-timer
Copy link
Collaborator

Queued 0b514f420336f0083b2363744ce7bdcdced7283f with parent 308fc23, future comparison URL.

@rust-timer
Copy link
Collaborator

rust-timer commented Jul 4, 2021

Finished benchmarking try commit (0b514f420336f0083b2363744ce7bdcdced7283f): comparison url.

Summary: This change led to significant mixed results 🤷 in compiler performance.

  • Large improvement in instruction counts (up to -5.4% on incr-unchanged builds of ripgrep-check)
  • Moderate regression in instruction counts (up to 3.7% on incr-patched: dummy fn builds of unused-warnings-check)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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 led to changes in compiler perf.

Next Steps: If you can justify the regressions found in this 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-review -S-waiting-on-perf +perf-regression

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 4, 2021
@cjgillot cjgillot marked this pull request as ready for review July 5, 2021 19:20
@cjgillot
Copy link
Contributor Author

cjgillot commented Jul 5, 2021

r? @Aaron1011
But without any hurry: we maybe should wait for the unstable fingerprint situation to be settled before exposing those queries to it.

@Aaron1011 Aaron1011 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 11, 2021
@cjgillot
Copy link
Contributor Author

cjgillot commented Nov 5, 2021

@Aaron1011, I split this PR into several others, to measure the perf impact of individual commits.

If their impact is reasonable, I suggest you review them independently.
(Having the commits separated would also help in case of a bug.)

@jackh726
Copy link
Member

jackh726 commented Nov 9, 2021

Marking as blocked on the above PRs - but I could also imagine it might be better to just land these in individual PRs.

@jackh726 jackh726 added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 9, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 24, 2021
Remove eval_always for inherent_impls.

Split off rust-lang#86056
r? `@ghost`
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 25, 2021
Remove eval_always from upvars.

Split off rust-lang#86056
r? `@ghost`
@apiraino
Copy link
Contributor

@apiraino apiraino added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 6, 2022
@JohnCSimon JohnCSimon added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 6, 2022
@Zoxc
Copy link
Contributor

Zoxc commented Feb 9, 2022

eval_always is quite useful as a performance optimization on queries with a lot of dependencies (basically the entire crate) since we don't have to load, check, record and save those dependencies to disk. Pretty much any change to the crate would cause these to be executed again anyway, so there's not much to gain by removing it.

Also take care to not remove eval_always from queries which read untracked state or have side effects.

@Dylan-DPC Dylan-DPC removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 19, 2022
@cjgillot cjgillot closed this Jul 13, 2022
@cjgillot cjgillot deleted the no-ee branch July 13, 2022 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) perf-regression Performance regression. S-blocked Status: Blocked on something else such as an RFC or other implementation work. 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.