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

Avoid some unnecessary query invocations. #121387

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Feb 21, 2024

Specifically this inlines const_eval_poly and avoids computing the generic params, the param env, normalizing the param env and erasing lifetimes on everything.

should fix the perf regression from #121087

@rustbot
Copy link
Collaborator

rustbot commented Feb 21, 2024

r? @lcnr

rustbot has assigned @lcnr.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Feb 21, 2024
@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 21, 2024

@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 Feb 21, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 21, 2024
…ion, r=<try>

Avoid some unnecessary query invocations.

Specifically this inlines `const_eval_poly` and avoids computing the generic params, the param env, normalizing the param env and erasing lifetimes on everything.

should fix the perf regression from rust-lang#121087
@bors
Copy link
Contributor

bors commented Feb 21, 2024

⌛ Trying commit 56d7af2 with merge 5dd0e76...

@bors
Copy link
Contributor

bors commented Feb 21, 2024

☀️ Try build successful - checks-actions
Build commit: 5dd0e76 (5dd0e762f2310f31dcc3a222af9b995ca83423fd)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5dd0e76): 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)
7.0% [0.5%, 45.8%] 8
Regressions ❌
(secondary)
252.5% [0.5%, 1555.6%] 7
Improvements ✅
(primary)
-0.7% [-1.9%, -0.3%] 5
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 1
All ❌✅ (primary) 4.1% [-1.9%, 45.8%] 13

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)
5.2% [1.7%, 18.7%] 6
Regressions ❌
(secondary)
29.9% [2.6%, 88.0%] 7
Improvements ✅
(primary)
-2.1% [-2.2%, -2.1%] 2
Improvements ✅
(secondary)
-0.9% [-0.9%, -0.9%] 3
All ❌✅ (primary) 3.3% [-2.2%, 18.7%] 8

Cycles

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)
7.4% [0.6%, 46.6%] 13
Regressions ❌
(secondary)
341.7% [38.7%, 1148.9%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 7.4% [0.6%, 46.6%] 13

Binary size

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

Bootstrap: 640.751s -> 643.134s (0.37%)
Artifact size: 308.59 MiB -> 308.64 MiB (0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Feb 21, 2024
@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 21, 2024

lolwat

@lcnr
Copy link
Contributor

lcnr commented Feb 22, 2024

@rustbot author ✨

@rustbot rustbot 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 Feb 22, 2024
@oli-obk oli-obk force-pushed the eager_const_failures_regression branch from 56d7af2 to 0df64c5 Compare February 22, 2024 09:35
@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 22, 2024

@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 Feb 22, 2024
@bors
Copy link
Contributor

bors commented Feb 22, 2024

⌛ Trying commit 0df64c5 with merge 76a24ac...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 22, 2024
…ion, r=<try>

Avoid some unnecessary query invocations.

Specifically this inlines `const_eval_poly` and avoids computing the generic params, the param env, normalizing the param env and erasing lifetimes on everything.

should fix the perf regression from rust-lang#121087
@bors
Copy link
Contributor

bors commented Feb 22, 2024

☀️ Try build successful - checks-actions
Build commit: 76a24ac (76a24ac565440d1bdf3a9aba6039f43ebde054ba)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (76a24ac): 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.7% [0.5%, 0.9%] 2
Improvements ✅
(primary)
-1.6% [-1.6%, -1.6%] 1
Improvements ✅
(secondary)
-2.7% [-2.7%, -2.7%] 1
All ❌✅ (primary) -1.6% [-1.6%, -1.6%] 1

Max RSS (memory usage)

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

Cycles

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

Binary size

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

Bootstrap: 648.961s -> 649.002s (0.01%)
Artifact size: 310.94 MiB -> 310.94 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 22, 2024
@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 22, 2024

Fixes the libc regression. Need to find out why it didn't affect the other benchmarks, and even had some negative effects on some

@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 23, 2024

@rustbot ready

the new regressions are just the usual inliner noise. const eval got more instructions, even though it was not touched at all

@RalfJung
Copy link
Member

The doc comment even says

Prefer this over tcx.param_env(def_id).with_reveal_all_normalized(tcx), as this method is more efficient.

Might be a good idea for a rustc lint?

@oli-obk oli-obk mentioned this pull request Feb 26, 2024
12 tasks
@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 26, 2024

@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 Feb 26, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 26, 2024
…ion, r=<try>

Avoid some unnecessary query invocations.

Specifically this inlines `const_eval_poly` and avoids computing the generic params, the param env, normalizing the param env and erasing lifetimes on everything.

should fix the perf regression from rust-lang#121087
@bors
Copy link
Contributor

bors commented Feb 26, 2024

⌛ Trying commit c9f78da with merge 1298e36...

@bors
Copy link
Contributor

bors commented Feb 26, 2024

☀️ Try build successful - checks-actions
Build commit: 1298e36 (1298e36829f301dfb6252700866e973ccd1a2aed)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1298e36): 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.3% [0.2%, 0.3%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.1%] 2
All ❌✅ (primary) 0.3% [0.2%, 0.3%] 3

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)
2.9% [2.9%, 2.9%] 1
Regressions ❌
(secondary)
3.3% [3.3%, 3.3%] 1
Improvements ✅
(primary)
-4.4% [-4.4%, -4.4%] 1
Improvements ✅
(secondary)
-3.0% [-3.0%, -3.0%] 1
All ❌✅ (primary) -0.7% [-4.4%, 2.9%] 2

Cycles

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

Binary size

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

Bootstrap: 651.162s -> 652.353s (0.18%)
Artifact size: 311.20 MiB -> 311.22 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 26, 2024
@oli-obk oli-obk force-pushed the eager_const_failures_regression branch from c9f78da to 0df64c5 Compare February 27, 2024 13:37
@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 27, 2024

reverted back to previous version

@oli-obk oli-obk force-pushed the eager_const_failures_regression branch from 0df64c5 to f83af38 Compare March 19, 2024 17:12
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the eager_const_failures_regression branch from f83af38 to 3ec5042 Compare March 19, 2024 17:30
@lcnr
Copy link
Contributor

lcnr commented Mar 22, 2024

I feel somewhat uncomfortable about this change, even though it does not seem to break anything right now 🤔 I also don't have an intuitive enough understanding of const eval

Though, given that it should only result in more errors, r=me after adding the test

@oli-obk
Copy link
Contributor Author

oli-obk commented Mar 26, 2024

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Mar 26, 2024

📌 Commit 3ec5042 has been approved by lcnr

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 Mar 26, 2024
@bors
Copy link
Contributor

bors commented Mar 26, 2024

⌛ Testing commit 3ec5042 with merge 519d892...

@bors
Copy link
Contributor

bors commented Mar 26, 2024

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 519d892 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 26, 2024
@bors bors merged commit 519d892 into rust-lang:master Mar 26, 2024
12 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Mar 26, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (519d892): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -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
Improvements ✅
(primary)
-1.0% [-1.7%, -0.3%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.0% [-1.7%, -0.3%] 2

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)
- - 0
Improvements ✅
(primary)
-1.8% [-3.8%, -0.7%] 15
Improvements ✅
(secondary)
-2.9% [-5.4%, -1.9%] 18
All ❌✅ (primary) -1.8% [-3.8%, -0.7%] 15

Cycles

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.8% [0.8%, 0.8%] 1
Regressions ❌
(secondary)
5.0% [5.0%, 5.0%] 1
Improvements ✅
(primary)
-1.8% [-3.1%, -0.5%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.9% [-3.1%, 0.8%] 3

Binary size

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

Bootstrap: 672.066s -> 672.189s (0.02%)
Artifact size: 315.70 MiB -> 315.72 MiB (0.01%)

@rustbot rustbot removed the perf-regression Performance regression. label Mar 26, 2024
@oli-obk oli-obk deleted the eager_const_failures_regression branch March 26, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

7 participants