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: Reduce clean::Type size #93963

Merged
merged 2 commits into from
May 21, 2022

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Feb 13, 2022

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
Collaborator

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
Member Author

Let's check perf results:

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

bors commented Feb 13, 2022

⌛ Trying commit 39bfc5aa215b429e93a6427fe9181b405a984c4c with merge f411aa6adf39ffb096ce20832581c5b35b0da171...

@bors
Copy link
Contributor

bors commented Feb 13, 2022

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

@rust-timer
Copy link
Collaborator

Queued f411aa6adf39ffb096ce20832581c5b35b0da171 with parent c26fbf8, future comparison URL.

@rust-timer
Copy link
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
Member Author

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

@camelid
Copy link
Member

camelid commented Feb 15, 2022

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
Copy link
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
src/librustdoc/clean/mod.rs Outdated Show resolved Hide resolved
@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
Copy link
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
Copy link
Member Author

And of course I forgot to run fmt...

@bors
Copy link
Contributor

bors commented May 2, 2022

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

@GuillaumeGomez
Copy link
Member Author

Fixed merge conflict.

@bors
Copy link
Contributor

bors commented May 15, 2022

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

@GuillaumeGomez
Copy link
Member Author

Fixed the conflict.

@camelid
Copy link
Member

camelid commented May 20, 2022

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
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
Copy link
Contributor

bors commented May 21, 2022

📌 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
Copy link
Contributor

bors commented May 21, 2022

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

@bors
Copy link
Contributor

bors commented May 21, 2022

☀️ 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
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