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

Encode ADT flags rather than recreating them from scratch at decoding time #127466

Closed
wants to merge 1 commit into from

Conversation

compiler-errors
Copy link
Member

r? lcnr

@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@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. S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 7, 2024
@bors
Copy link
Contributor

bors commented Jul 7, 2024

⌛ Trying commit e89a228 with merge 77c0460...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 7, 2024
Encode ADT flags rather than recreating them from scratch at decoding time

r? lcnr
/// Creates a new `AdtDefData`.
pub(super) fn new(
tcx: TyCtxt<'_>,
did: DefId,
did: LocalDefId,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting this to local so we enforce that AdtDefData::new is called only on local def ids.

@@ -249,15 +249,25 @@ impl Into<DataTypeKind> for AdtKind {
}

impl AdtDefData {
pub(super) fn new_from_flags(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this ctor is kinda redundant, i could also just make all the fields pub(super) -- OR just pull TyCtxt::mk_adt_def_from_flags/TyCtxt::mk_adt_def into a new impl in this module. I don't really care.

@bors
Copy link
Contributor

bors commented Jul 7, 2024

☀️ Try build successful - checks-actions
Build commit: 77c0460 (77c04600363afec9e299d16225d0453b448afe5e)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (77c0460): comparison URL.

Overall result: ❌✅ regressions and 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)
1.7% [1.7%, 1.7%] 1
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-0.2%, -0.2%] 1

Max RSS (memory usage)

Results (primary 0.3%, secondary 6.1%)

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.4% [1.4%, 1.4%] 1
Regressions ❌
(secondary)
6.1% [6.1%, 6.1%] 1
Improvements ✅
(primary)
-0.9% [-0.9%, -0.9%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [-0.9%, 1.4%] 2

Cycles

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

Binary size

Results (primary 0.3%, secondary 0.8%)

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.3% [0.0%, 1.0%] 122
Regressions ❌
(secondary)
0.8% [0.1%, 1.5%] 27
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.0%, 1.0%] 122

Bootstrap: 699.476s -> 699.246s (-0.03%)
Artifact size: 328.39 MiB -> 328.43 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 7, 2024
@compiler-errors
Copy link
Member Author

Likely noise

@lcnr
Copy link
Contributor

lcnr commented Jul 8, 2024

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Jul 8, 2024

📌 Commit e89a228 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 8, 2024
@bors
Copy link
Contributor

bors commented Jul 8, 2024

☔ The latest upstream changes (presumably #127476) made this pull request unmergeable. Please resolve the merge conflicts.

@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 8, 2024
@compiler-errors
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Jul 8, 2024

📌 Commit 65f6819 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 8, 2024
@oli-obk
Copy link
Contributor

oli-obk commented Jul 8, 2024

@bors r-

The binary size regression is real

What's the motivation for this?

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 8, 2024
@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 8, 2024
@Kobzol
Copy link
Contributor

Kobzol commented Jul 8, 2024

(Note that this only seems to affect metadata size, not actual binary size of binaries.)

I was also wondering about the motivation given this size regression though.

@compiler-errors
Copy link
Member Author

compiler-errors commented Jul 8, 2024

This was requested in #127437 (comment). @lcnr has some interest in migrating the compiler to stop encoding built-in attrs across crates. IDK if they have a tracking issue for this, but if they don't, they should probably make one. I don't particularly care about this work, so if anyone wants to pick it up, they can do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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