Skip to content

rustdoc: strategic boxing to reduce the size of ItemKind and Type #100645

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 2 commits into from
Aug 21, 2022

Conversation

notriddle
Copy link
Contributor

The Type change redesigns QPath to box the entire data structure instead of boxing self_type and the trait_.

This reduces the size of several ItemKind variants, leaving Impl as the biggest variant. The ItemKind change boxes that variant's payload.

This reduces the memory consumption of ItemKind.
@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Aug 16, 2022
@rust-highfive
Copy link
Contributor

r? @GuillaumeGomez

(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 Aug 16, 2022
@notriddle
Copy link
Contributor Author

As soon as this is done building, I'll run a perf experiment to see if this is actually a win.

@notriddle
Copy link
Contributor Author

@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 Aug 16, 2022
@bors
Copy link
Collaborator

bors commented Aug 16, 2022

⌛ Trying commit 238bcc9 with merge eb4510756c119d10c4fee50388ef4569b090e88a...

@bors
Copy link
Collaborator

bors commented Aug 16, 2022

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

@rust-timer
Copy link
Collaborator

Queued eb4510756c119d10c4fee50388ef4569b090e88a with parent 5746c75, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (eb4510756c119d10c4fee50388ef4569b090e88a): comparison url.

Instruction count

  • Primary benchmarks: ❌ relevant regression found
  • Secondary benchmarks: no relevant changes found
mean1 max count2
Regressions ❌
(primary)
1.0% 1.0% 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.0% 1.0% 1

Max RSS (memory usage)

Results
  • Primary benchmarks: ✅ relevant improvements found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.7% 3.7% 1
Improvements ✅
(primary)
-2.1% -4.1% 6
Improvements ✅
(secondary)
-2.1% -2.6% 2
All ❌✅ (primary) -2.1% -4.1% 6

Cycles

Results
  • Primary benchmarks: ✅ relevant improvement found
  • Secondary benchmarks: no relevant changes found
mean1 max count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.5% -2.5% 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.5% -2.5% 1

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

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

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 16, 2022
@notriddle notriddle marked this pull request as ready for review August 17, 2022 00:20
@rustbot
Copy link
Collaborator

rustbot commented Aug 17, 2022

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

@notriddle
Copy link
Contributor Author

notriddle commented Aug 17, 2022

Looks like a real memory usage improvement on stm32f4-0.14.0, based on the high significance factor. Everything else looks tiny or straight-up spurious (because this PR can't possibly affect anything other than doc builds).

@GuillaumeGomez
Copy link
Member

Other than my question, looks really good!

@GuillaumeGomez
Copy link
Member

Thanks!

@bors r+ r=never

@bors
Copy link
Collaborator

bors commented Aug 17, 2022

📌 Commit 238bcc9 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Aug 17, 2022

💡 This pull request was already approved, no need to approve it again.

@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 Aug 17, 2022
@bors
Copy link
Collaborator

bors commented Aug 17, 2022

📌 Commit 238bcc9 has been approved by never

It is now in the queue for this repository.

@compiler-errors
Copy link
Member

The commit says r=never lol,

@bors r-

@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 Aug 17, 2022
@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 Aug 17, 2022
@compiler-errors
Copy link
Member

@bors r=GuillaumeGomez rollup=never

@bors
Copy link
Collaborator

bors commented Aug 17, 2022

📌 Commit 238bcc9 has been approved by GuillaumeGomez

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 Aug 17, 2022
@bors
Copy link
Collaborator

bors commented Aug 21, 2022

⌛ Testing commit 238bcc9 with merge 650bff8...

@bors
Copy link
Collaborator

bors commented Aug 21, 2022

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing 650bff8 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 21, 2022
@bors bors merged commit 650bff8 into rust-lang:master Aug 21, 2022
@rustbot rustbot added this to the 1.65.0 milestone Aug 21, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (650bff8): comparison url.

Instruction count

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

Max RSS (memory usage)

Results
  • Primary benchmarks: ✅ relevant improvements found
  • Secondary benchmarks: ✅ relevant improvements found
mean1 max count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.5% -4.5% 4
Improvements ✅
(secondary)
-2.2% -3.1% 6
All ❌✅ (primary) -2.5% -4.5% 4

Cycles

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.4% 3.4% 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.7% -4.9% 5
All ❌✅ (primary) - - 0

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

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@notriddle notriddle deleted the notriddle/rustdoc-diet-plan branch August 21, 2022 20:56
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.

8 participants