Skip to content

Box Impl.blanket_impl to reduce size #85311

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 1 commit into from
May 15, 2021
Merged

Conversation

camelid
Copy link
Member

@camelid camelid commented May 15, 2021

Blanket impls are probably not super common, and Type is a fairly
large type, so this should reduce Impl's size by a lot: Option<Type>
is around 96 bytes, and Option<Box<Type>> is 8 bytes, so it's a big
difference!

Blanket impls are probably not super common, and `Type` is a fairly
large type, so this should reduce `Impl`'s size by a lot: `Option<Type>`
is around 96 bytes, and `Option<Box<Type>>` is 8 bytes, so it's a big
difference!
@camelid camelid added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. labels May 15, 2021
@rust-highfive
Copy link
Contributor

r? @CraftSpider

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 15, 2021
@camelid
Copy link
Member Author

camelid commented May 15, 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 May 15, 2021
@camelid camelid removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 15, 2021
@camelid
Copy link
Member Author

camelid commented May 15, 2021

Weird, bors does not seem to have noticed this PR...

@bors try

@camelid camelid closed this May 15, 2021
@camelid camelid reopened this May 15, 2021
@camelid
Copy link
Member Author

camelid commented May 15, 2021

@bors try

@bors
Copy link
Collaborator

bors commented May 15, 2021

⌛ Trying commit f57537e with merge 742560ab710e5cd8eb736df68b736930cc190b2c...

@camelid
Copy link
Member Author

camelid commented May 15, 2021

Closing and reopening seems to have done the trick.

@camelid
Copy link
Member Author

camelid commented May 15, 2021

I just checked locally and this change reduces Impl's size from 376 to 288 bytes, which is exactly what I expected! It also reduces ItemKind's size from 384 to 296 bytes, because Impl is what causes ItemKind to be so large.

@camelid camelid added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 15, 2021
@bors
Copy link
Collaborator

bors commented May 15, 2021

☀️ Try build successful - checks-actions
Build commit: 742560ab710e5cd8eb736df68b736930cc190b2c (742560ab710e5cd8eb736df68b736930cc190b2c)

@rust-timer
Copy link
Collaborator

Queued 742560ab710e5cd8eb736df68b736930cc190b2c with parent 1025db8, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (742560ab710e5cd8eb736df68b736930cc190b2c): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

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

@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 May 15, 2021
@jyn514
Copy link
Member

jyn514 commented May 15, 2021

@bors r+

@bors
Copy link
Collaborator

bors commented May 15, 2021

📌 Commit f57537e 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-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 15, 2021
@bors
Copy link
Collaborator

bors commented May 15, 2021

⌛ Testing commit f57537e with merge c6dd87a...

@bors
Copy link
Collaborator

bors commented May 15, 2021

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 15, 2021
@bors bors merged commit c6dd87a into rust-lang:master May 15, 2021
@rustbot rustbot added this to the 1.54.0 milestone May 15, 2021
@camelid camelid deleted the box-blanket-impl branch May 15, 2021 21:37
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. 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