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

rustdoc: Box some fields of GenericParamDefKind to reduce size #89998

Merged
merged 3 commits into from
Oct 21, 2021

Conversation

camelid
Copy link
Member

@camelid camelid commented Oct 18, 2021

This change shrinks GenericParamDef from 120 to 56 bytes. GenericParamDef is
used a lot, so the extra indirection should hopefully be worth the size savings.

r? @ghost

@camelid camelid added I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. I-compiletime Issue: Problems and improvements with respect to compile times. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. labels Oct 18, 2021
@camelid
Copy link
Member Author

camelid commented Oct 18, 2021

@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 Oct 18, 2021
@bors
Copy link
Contributor

bors commented Oct 18, 2021

⌛ Trying commit 25b80baf97e7d1275ce6ecd97c1a763763af42fa with merge 5374adb76f795a93b9b3b2111a0b6fe3347f003b...

@bors
Copy link
Contributor

bors commented Oct 18, 2021

☀️ Try build successful - checks-actions
Build commit: 5374adb76f795a93b9b3b2111a0b6fe3347f003b (5374adb76f795a93b9b3b2111a0b6fe3347f003b)

@rust-timer
Copy link
Collaborator

Queued 5374adb76f795a93b9b3b2111a0b6fe3347f003b with parent 5e02151, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5374adb76f795a93b9b3b2111a0b6fe3347f003b): comparison url.

Summary: This benchmark run did not return any relevant changes.

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

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 18, 2021
@jyn514
Copy link
Member

jyn514 commented Oct 18, 2021

Minor improvements on instruction count, medium improvements on max rss :) I haven't read the diff but this seems fine to land otherwise.

src/librustdoc/clean/types.rs Outdated Show resolved Hide resolved
src/librustdoc/clean/mod.rs Show resolved Hide resolved
@jyn514 jyn514 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 18, 2021
@camelid camelid added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 18, 2021
src/librustdoc/clean/mod.rs Outdated Show resolved Hide resolved
@jyn514 jyn514 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 Oct 18, 2021
This reduces the size of `GenericParamDef` a bit, but some of the size
savings are hidden because of the `ty` field of the `Const` variant.
I will box that in the next commit.
This cuts the size of `GenericParamDef` in half, from 104 bytes to 56
bytes. I think the extra indirection should be worth the size savings.
@camelid camelid added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 18, 2021
@jyn514
Copy link
Member

jyn514 commented Oct 19, 2021

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Oct 19, 2021

📌 Commit 9098689 has been approved by jyn514

@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 Oct 19, 2021
@bors
Copy link
Contributor

bors commented Oct 20, 2021

⌛ Testing commit 9098689 with merge 29fa27b373bdee0193ac266bf0f1d21e4fec8f68...

@bors
Copy link
Contributor

bors commented Oct 20, 2021

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 20, 2021
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@jyn514
Copy link
Member

jyn514 commented Oct 20, 2021

@bors retry

@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 Oct 20, 2021
@bors
Copy link
Contributor

bors commented Oct 21, 2021

⌛ Testing commit 9098689 with merge 4626184...

@bors
Copy link
Contributor

bors commented Oct 21, 2021

☀️ Test successful - checks-actions
Approved by: jyn514
Pushing 4626184 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 21, 2021
@bors bors merged commit 4626184 into rust-lang:master Oct 21, 2021
@rustbot rustbot added this to the 1.58.0 milestone Oct 21, 2021
@camelid camelid deleted the box-default branch October 21, 2021 04:26
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4626184): comparison url.

Summary: This benchmark run did not return any relevant changes.

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

@rustbot label: -perf-regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. I-compiletime Issue: Problems and improvements with respect to compile times. 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-rustdoc Relevant to the rustdoc 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