Skip to content

replace_bound_vars fast path: check predicates, don't check consts #99232

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

Merged
merged 2 commits into from
Jul 18, 2022

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Jul 14, 2022

split out from #98900

ty::Const doesn't have precomputed type flags, so
computing has_vars_bound_at_or_above for constants
requires us to visit the const and its contained types
and constants. A noop fold should be pretty much equally as
fast so removing it prevents us from walking the constant twice
in case it contains bound vars.

r? @jackh726

`ty::Const` doesn't have precomputed type flags, so
computing `has_vars_bound_at_or_above` for constants
requires us to visit the const and its contained types
and constants. A noop fold should be pretty much equally as
fast so removing it prevents us from walking the constant twice
in case it contains bound vars.
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 14, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 14, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Jul 14, 2022

@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 14, 2022
@bors
Copy link
Collaborator

bors commented Jul 14, 2022

⌛ Trying commit 39a990d with merge 986b0925e1a63333e182d460bda90013cc286a0c...

@lcnr lcnr force-pushed the no-bound-vars-check branch from d661bba to 864d2f3 Compare July 14, 2022 10:48
@lcnr
Copy link
Contributor Author

lcnr commented Jul 14, 2022

@rust-timer build 986b0925e1a63333e182d460bda90013cc286a0c

@rust-timer
Copy link
Collaborator

Queued 986b0925e1a63333e182d460bda90013cc286a0c with parent 431c6f8, future comparison URL.

@jackh726
Copy link
Member

r=me with clean perf

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (986b0925e1a63333e182d460bda90013cc286a0c): comparison url.

Instruction count

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

Max RSS (memory usage)

Results
  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: 😿 relevant regressions found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
5.3% 7.3% 4
Improvements 🎉
(primary)
-2.6% -2.6% 1
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) -2.6% -2.6% 1

Cycles

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 🎉 relevant improvement found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-3.0% -3.0% 1
All 😿🎉 (primary) N/A N/A 0

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

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

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 14, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Jul 14, 2022

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented Jul 14, 2022

📌 Commit 864d2f3 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 Jul 14, 2022
@lcnr lcnr changed the title remove ct.has_vars_bound_at_or_above calls replace_bound_vars fast path: check predicates, don't check consts Jul 14, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Jul 14, 2022

@bors r-
@bors r=jackh726

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 14, 2022
@bors
Copy link
Collaborator

bors commented Jul 14, 2022

📌 Commit 864d2f3 has been approved by jackh726

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 14, 2022
@bors
Copy link
Collaborator

bors commented Jul 18, 2022

⌛ Testing commit 864d2f3 with merge 144227d...

@bors
Copy link
Collaborator

bors commented Jul 18, 2022

☀️ Test successful - checks-actions
Approved by: jackh726
Pushing 144227d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 18, 2022
@bors bors merged commit 144227d into rust-lang:master Jul 18, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 18, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (144227d): comparison url.

Instruction count

  • Primary benchmarks: 🎉 relevant improvements found
  • Secondary benchmarks: no relevant changes found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-0.6% -0.7% 6
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) -0.6% -0.7% 6

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
2.6% 2.7% 2
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-2.6% -2.6% 1
All 😿🎉 (primary) N/A N/A 0

Cycles

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: 🎉 relevant improvement found
mean1 max count2
Regressions 😿
(primary)
3.1% 3.1% 1
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-2.6% -2.6% 1
Improvements 🎉
(secondary)
-3.0% -3.0% 1
All 😿🎉 (primary) 0.2% 3.1% 2

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

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@lcnr lcnr deleted the no-bound-vars-check branch July 19, 2022 07:23
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.

6 participants