Skip to content

rustdoc: Reduce clean::Type size - #93963

Merged
bors merged 2 commits into
rust-lang:masterfrom
GuillaumeGomez:reduce-clean-type-size
May 21, 2022
Merged

rustdoc: Reduce clean::Type size#93963
bors merged 2 commits into
rust-lang:masterfrom
GuillaumeGomez:reduce-clean-type-size

Conversation

@GuillaumeGomez

@GuillaumeGomez GuillaumeGomez commented Feb 13, 2022

Copy link
Copy Markdown
Member

There is no need to keep the DefId around since it's allow used to compute if we should show a cast or not. As such, we can simply directly store the boolean.

I think it's not what you had in mind @camelid but I guess it's still an improvement? 😉

It was discussed in #93941.

r? @camelid

@rust-highfive

Copy link
Copy Markdown
Contributor

Some changes occurred in clean/types.rs.

cc @camelid

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Feb 13, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 13, 2022
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Let's check perf results:

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown
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 Feb 13, 2022
@bors

bors commented Feb 13, 2022

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 39bfc5aa215b429e93a6427fe9181b405a984c4c with merge f411aa6adf39ffb096ce20832581c5b35b0da171...

@bors

bors commented Feb 13, 2022

Copy link
Copy Markdown
Collaborator

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

@rust-timer

Copy link
Copy Markdown
Collaborator

Queued f411aa6adf39ffb096ce20832581c5b35b0da171 with parent c26fbf8, future comparison URL.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (f411aa6adf39ffb096ce20832581c5b35b0da171): comparison url.

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

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 removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 13, 2022
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Almost no changes on perf and small improvement on max rss. I'm a bit disappointed... :'(

Comment thread src/librustdoc/clean/types.rs Outdated
@camelid

camelid commented Feb 15, 2022

Copy link
Copy Markdown
Member

Even if there's not an immediate perf effect, getting rid of that field altogether is a good cleanup.

@camelid camelid 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 Feb 15, 2022
@JohnCSimon JohnCSimon 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 20, 2022
@GuillaumeGomez
GuillaumeGomez force-pushed the reduce-clean-type-size branch from 39bfc5a to e4c4ffa Compare April 12, 2022 13:06
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Updated!

@GuillaumeGomez GuillaumeGomez 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 Apr 12, 2022
Comment thread src/librustdoc/clean/mod.rs Outdated
@camelid camelid 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 Apr 25, 2022
@GuillaumeGomez
GuillaumeGomez force-pushed the reduce-clean-type-size branch from e4c4ffa to a2e35fa Compare April 26, 2022 14:41
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

@camelid I was able to do it by passing down the current (aka "real") DefId directly to where it's computed. It has two changes but the diff is huge because of the indent change. Does it look better to you?

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
GuillaumeGomez force-pushed the reduce-clean-type-size branch from a2e35fa to e38d16a Compare April 26, 2022 15:04
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

And of course I forgot to run fmt...

@bors

bors commented May 2, 2022

Copy link
Copy Markdown
Collaborator

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

@GuillaumeGomez
GuillaumeGomez force-pushed the reduce-clean-type-size branch from e38d16a to aab986b Compare May 3, 2022 14:56
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Fixed merge conflict.

@bors

bors commented May 15, 2022

Copy link
Copy Markdown
Collaborator

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

@GuillaumeGomez
GuillaumeGomez force-pushed the reduce-clean-type-size branch from aab986b to 2e1369c Compare May 15, 2022 11:58
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Fixed the conflict.

@camelid

camelid commented May 20, 2022

Copy link
Copy Markdown
Member

Sorry, I don't think I understand this code well enough to do a proper review.

r? rust-lang/rustdoc

@rust-highfive rust-highfive assigned notriddle and unassigned camelid May 20, 2022
@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 May 20, 2022
@notriddle

Copy link
Copy Markdown
Contributor

This looks fine to me. It's moving a computation to happen earlier, so it stores a boolean instead of a DefId.

GitHub Tip: This change isn't actually very big. Use https://github.com/rust-lang/rust/pull/93963/files?w=1 to ignore most of the indentation changes.

@bors r+

@bors

bors commented May 21, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 2e1369c has been approved by notriddle

@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 May 21, 2022
@bors

bors commented May 21, 2022

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 2e1369c with merge 5f33adc...

@bors

bors commented May 21, 2022

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: notriddle
Pushing 5f33adc to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 21, 2022
@bors
bors merged commit 5f33adc into rust-lang:master May 21, 2022
@rustbot rustbot added this to the 1.63.0 milestone May 21, 2022
@GuillaumeGomez
GuillaumeGomez deleted the reduce-clean-type-size branch May 21, 2022 11:33
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (5f33adc): comparison url.

Instruction count

  • Primary benchmarks: 🎉 relevant improvements found
  • Secondary benchmarks: 🎉 relevant improvements found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 0 0 12 20 12
mean2 N/A N/A -0.4% -0.6% -0.4%
max N/A N/A -0.8% -0.8% -0.8%

Max RSS (memory usage)

Results
  • Primary benchmarks: 🎉 relevant improvements found
  • Secondary benchmarks: 🎉 relevant improvements found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 0 1 13 17 13
mean2 N/A 1.1% -1.5% -1.5% -1.5%
max N/A 1.1% -3.1% -2.9% -3.1%

Cycles

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: mixed results
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 1 3 1 1 2
mean2 2.6% 2.1% -2.0% -4.8% 0.3%
max 2.6% 2.4% -2.0% -4.8% 2.6%

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

@rustbot label: -perf-regression

Footnotes

  1. number of relevant changes 2 3

  2. the arithmetic mean of the percent change 2 3

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-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.

9 participants