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

Shrink thir::Expr #100944

Merged
merged 7 commits into from
Aug 26, 2022
Merged

Shrink thir::Expr #100944

merged 7 commits into from
Aug 26, 2022

Conversation

nnethercote
Copy link
Contributor

The macro already generates other stuff, might as well generate these
index types as well.
This shrinks several large variants of `ExprKind`.
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 24, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 24, 2022
@nnethercote
Copy link
Contributor Author

Local measurements show this reduces peak memory usage for deep-vector by up to 13%.

I took a mixture of strategies here. For Block I introduced a new BlockId type. For Closure and InlineAsm I just used Box, because they are less common and it's easier.

Like expressions, statements, and match arms. This shrinks `thir::Stmt`
and is a precursor to further shrinking `thir::Expr`.
This shrinks `thir::Expr`.
This shrinks `thir::Expr`.
This matches the naming scheme used elsewhere, e.g. in the AST, and
avoids name clashes with the `ExprKind::Closure` variant.
@rust-log-analyzer

This comment has been minimized.

@nnethercote
Copy link
Contributor Author

@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 Aug 24, 2022
@bors
Copy link
Contributor

bors commented Aug 24, 2022

⌛ Trying commit 5a41eb8 with merge 0bdca9b6274dd9a790450bd2a0be8979dd91690a...

@bors
Copy link
Contributor

bors commented Aug 24, 2022

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

@rust-timer
Copy link
Collaborator

Queued 0bdca9b6274dd9a790450bd2a0be8979dd91690a with parent 25ea5a3, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0bdca9b6274dd9a790450bd2a0be8979dd91690a): comparison URL.

Overall result: ✅ improvements - no 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.

@bors rollup=never
@rustbot label: +S-waiting-on-review -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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 3
All ❌✅ (primary) - - 0

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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.7% [3.7%, 3.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-8.4% [-14.5%, -1.6%] 8
All ❌✅ (primary) - - 0

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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.6% [-3.2%, -2.1%] 3
Improvements ✅
(secondary)
-2.7% [-3.3%, -2.3%] 6
All ❌✅ (primary) -2.6% [-3.2%, -2.1%] 3

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

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

Perf results look good: we see the expected max-rss improvements for deep-vector, and a suggestion of small improvements in cycles and cache misses across many benchmarks (esp. if you check "Show non-relevant results").

@cjgillot
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Aug 24, 2022

📌 Commit 5a41eb8 has been approved by cjgillot

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 Aug 24, 2022
@bors
Copy link
Contributor

bors commented Aug 26, 2022

⌛ Testing commit 5a41eb8 with merge 8a13871...

@bors
Copy link
Contributor

bors commented Aug 26, 2022

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing 8a13871 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 26, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8a13871): 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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.9% [-1.1%, -0.6%] 6
All ❌✅ (primary) - - 0

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.

mean1 range count2
Regressions ❌
(primary)
3.0% [3.0%, 3.0%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-9.5% [-15.9%, -3.1%] 7
All ❌✅ (primary) 3.0% [3.0%, 3.0%] 1

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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.6%, -1.8%] 2
All ❌✅ (primary) - - 0

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@nnethercote nnethercote deleted the shrink-thir-Expr branch August 28, 2022 22:42
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