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 rustc_parse_format::Piece #105363

Merged
merged 2 commits into from
Dec 10, 2022

Conversation

WaffleLapkin
Copy link
Member

This makes both variants closer together in size (previously they were different by 208 bytes -- 16 vs 224). This may make things worse, but it's worth a try.

r? @nnethercote

This makes both variants closer together in size (previously they were
different by 208 bytes -- 16 vs 224). This may make things worse, but
it's worth a try.
@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 Dec 6, 2022
@Kobzol
Copy link
Contributor

Kobzol commented Dec 6, 2022

@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 Dec 6, 2022
@bors
Copy link
Contributor

bors commented Dec 6, 2022

⌛ Trying commit 78060cb with merge 246e5ade5454a7cc83867bc0bcb8603bda642504...

@bors
Copy link
Contributor

bors commented Dec 6, 2022

☀️ Try build successful - checks-actions
Build commit: 246e5ade5454a7cc83867bc0bcb8603bda642504 (246e5ade5454a7cc83867bc0bcb8603bda642504)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (246e5ade5454a7cc83867bc0bcb8603bda642504): 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-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
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.6%, -0.3%] 4
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.

mean range count
Regressions ❌
(primary)
1.1% [1.1%, 1.1%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.6%, -2.2%] 3
All ❌✅ (primary) 1.1% [1.1%, 1.1%] 2

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)
2.2% [1.4%, 3.0%] 3
Regressions ❌
(secondary)
3.1% [3.1%, 3.1%] 1
Improvements ✅
(primary)
-0.6% [-0.6%, -0.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.5% [-0.6%, 3.0%] 4

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 6, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (246e5ade5454a7cc83867bc0bcb8603bda642504): 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-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
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.6%, -0.3%] 4
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.

mean range count
Regressions ❌
(primary)
1.1% [1.1%, 1.1%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.6%, -2.2%] 3
All ❌✅ (primary) 1.1% [1.1%, 1.1%] 2

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)
2.2% [1.4%, 3.0%] 3
Regressions ❌
(secondary)
3.1% [3.1%, 3.1%] 1
Improvements ✅
(primary)
-0.6% [-0.6%, -0.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.5% [-0.6%, 3.0%] 4

@nnethercote
Copy link
Contributor

Some sub-1% instruction count wins on deep-vector, plus an intriguing but possibly too-good-to-be-true -0.4% reduction in bootstrap time.

@WaffleLapkin Do you still want to proceed? If so, adding a static_assert_size! would be a good idea. Otherwise, the code changes are fine.

@nnethercote nnethercote 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 Dec 8, 2022
@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Dec 8, 2022
@WaffleLapkin
Copy link
Member Author

@nnethercote Added the assert 👍🏻
@rustbot label -A-bootstrap

@rustbot rustbot removed the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Dec 8, 2022
@nnethercote
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Dec 8, 2022

📌 Commit e4b4d25315abaf0022a2ee53953f63daaae67382 has been approved by nnethercote

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 Dec 8, 2022
@nnethercote
Copy link
Contributor

Wait, there's a size assertion failure:

error[E0308]: mismatched types
   --> /checkout/compiler/rustc_index/src/lib.rs:29:32
    |
27  | macro_rules! static_assert_size {
    | ------------------------------- in this expansion of `rustc_data_structures::static_assert_size!`
28  |     ($ty:ty, $size:expr) => {
29  |         const _: [(); $size] = [(); ::std::mem::size_of::<$ty>()];
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an array with a fixed size of 24 elements, found one with 16 elements
    |
   ::: compiler/rustc_parse_format/src/lib.rs:913:1
    |
913 | rustc_data_structures::static_assert_size!(Piece<'_>, 24);
    | --------------------------------------------------------- in this macro invocation

@bors r-

@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 Dec 8, 2022
@nnethercote
Copy link
Contributor

Yeah, 16 seems the right size: 8 bytes for the tag, and 8 bytes for the single pointer/Box field in each variant.

@WaffleLapkin
Copy link
Member Author

Right, I forgot that I test on arm xD

Yeah, 16 seems the right size: 8 bytes for the tag, and 8 bytes for the single pointer/Box field in each variant.

This is not actually right, the first field is &str, which is 16 bytes, the tag is actually 0 bytes, I assume instead of a 8 bytes tag we use &str's niche.

@rust-cloud-vms rust-cloud-vms bot force-pushed the thin2win_box_next_argument branch from e4b4d25 to c44c82d Compare December 8, 2022 22:51
@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Dec 8, 2022
@nnethercote
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Dec 9, 2022

📌 Commit c44c82d has been approved by nnethercote

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Dec 9, 2022

🌲 The tree is currently closed for pull requests below priority 10. This pull request will be tested once the tree is reopened.

@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 Dec 9, 2022
@bors
Copy link
Contributor

bors commented Dec 9, 2022

⌛ Testing commit c44c82d with merge 0d5573e...

@bors
Copy link
Contributor

bors commented Dec 10, 2022

☀️ Test successful - checks-actions
Approved by: nnethercote
Pushing 0d5573e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 10, 2022
@bors bors merged commit 0d5573e into rust-lang:master Dec 10, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 10, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0d5573e): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

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)
1.6% [1.6%, 1.6%] 1
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
-0.8% [-1.0%, -0.8%] 3
All ❌✅ (primary) -3.0% [-3.0%, -3.0%] 1

Cycles

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

Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
…ent, r=nnethercote

Shrink `rustc_parse_format::Piece`

This makes both variants closer together in size (previously they were different by 208 bytes -- 16 vs 224). This may make things worse, but it's worth a try.

r? `@nnethercote`
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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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