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: shrink GenericArgs/PathSegment with boxed slices #97195

Merged
merged 5 commits into from
May 23, 2022

Conversation

notriddle
Copy link
Contributor

This PR also contains a few cleanup bits and pieces, but one of them is a broken intra-doc link, and the other is removing an unused Hash impl. The last commit is the one that matters.

@rust-highfive
Copy link
Collaborator

Some changes occurred in clean/types.rs.

cc @camelid

@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels May 19, 2022
@rust-highfive
Copy link
Collaborator

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 19, 2022
@camelid
Copy link
Member

camelid commented May 20, 2022

r? @camelid

I think we tried this and found it wasn't very effective. But, I may be misremembering, so:
@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rust-highfive rust-highfive assigned camelid and unassigned CraftSpider May 20, 2022
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 20, 2022
@bors
Copy link
Contributor

bors commented May 20, 2022

⌛ Trying commit d943ac87ce504a756844cca8dc7bbdc6ce437abe with merge d5582f58e0e5702a3a02bd2e0f551dcc1bccc8e1...

@bors
Copy link
Contributor

bors commented May 20, 2022

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

@rust-timer
Copy link
Collaborator

Queued d5582f58e0e5702a3a02bd2e0f551dcc1bccc8e1 with parent 4d6992b, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d5582f58e0e5702a3a02bd2e0f551dcc1bccc8e1): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regressions found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 10 21 0 0 10
mean2 0.5% 0.7% N/A N/A 0.5%
max 1.0% 1.1% N/A N/A 1.0%

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 15 19 15
mean2 N/A 3.0% -3.1% -2.8% -3.1%
max N/A 3.0% -4.1% -3.4% -4.1%

Cycles

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: 😿 relevant regressions found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 1 2 1 0 2
mean2 1.8% 1.9% -1.9% N/A -0.0%
max 1.8% 2.1% -1.9% N/A -1.9%

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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Footnotes

  1. number of relevant changes 2 3

  2. the arithmetic mean of the percent change 2 3

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels May 20, 2022
@notriddle
Copy link
Contributor Author

It seems to reduce the Max-RSS most of the time, but it's regressing on cycle count, probably because it's shrinking-to-fit too often.

The generic args are created in a few places, but most of them are produced by calling Iterator::map on a trusted length iterator, so those should be producing perfectly-sized Vecs. The exception is substs_to_args, which is skipping the first generic arg, because that's Self and Self is Special.

That function should be able to compute the expected capacity of a Vec when it's just skipping the first item. Let's try.

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

bors commented May 20, 2022

⌛ Trying commit 123b97a66cbef47015417dc489f091976e1b66ac with merge 8d56ab6db0538cedcd8d66b3e11f7c6fa4e6752a...

@Kobzol
Copy link
Contributor

Kobzol commented May 20, 2022

FWIW, I have been trying something similar recently, without much success. Maybe you can find some inspiration there.

@bors
Copy link
Contributor

bors commented May 20, 2022

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

@rust-timer
Copy link
Collaborator

Queued 8d56ab6db0538cedcd8d66b3e11f7c6fa4e6752a with parent 22ee395, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8d56ab6db0538cedcd8d66b3e11f7c6fa4e6752a): comparison url.

Instruction count

  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 🎉 relevant improvement found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 0 0 0 1 0
mean2 N/A N/A N/A -0.6% N/A
max N/A N/A N/A -0.6% N/A

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 21 22 21
mean2 N/A 1.4% -2.6% -2.7% -2.6%
max N/A 1.4% -4.2% -4.9% -4.2%

Cycles

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: 🎉 relevant improvement found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 1 0 2 1 3
mean2 1.8% N/A -2.4% -2.5% -1.0%
max 1.8% N/A -2.8% -2.5% -2.8%

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. number of relevant changes 2 3

  2. the arithmetic mean of the percent change 2 3

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels May 20, 2022
@Kobzol
Copy link
Contributor

Kobzol commented May 20, 2022

Very nice RSS results! I wonder why my (almost same) approach didn't work as nicely 🤔 Maybe I just changed too much stuff at once. Or I should have tried the perf. run on CI after all :)

@notriddle notriddle force-pushed the notriddle/cleanup branch from 123b97a to 3657d09 Compare May 21, 2022 14:56
@notriddle
Copy link
Contributor Author

r? @GuillaumeGomez

@GuillaumeGomez
Copy link
Member

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented May 23, 2022

📌 Commit 207f649 has been approved by GuillaumeGomez

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

bors commented May 23, 2022

⌛ Testing commit 207f649 with merge 32c8c5d...

@bors
Copy link
Contributor

bors commented May 23, 2022

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing 32c8c5d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 23, 2022
@bors bors merged commit 32c8c5d into rust-lang:master May 23, 2022
@rustbot rustbot added this to the 1.63.0 milestone May 23, 2022
@notriddle notriddle deleted the notriddle/cleanup branch May 23, 2022 13:54
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (32c8c5d): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regression found
  • Secondary benchmarks: no relevant changes found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 1 0 0 0 1
mean2 0.4% N/A N/A N/A 0.4%
max 0.4% N/A N/A N/A 0.4%

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 0 18 22 18
mean2 N/A N/A -2.3% -2.3% -2.3%
max N/A N/A -3.3% -3.2% -3.3%

Cycles

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: 🎉 relevant improvements found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 1 0 2 4 3
mean2 1.9% N/A -2.2% -1.9% -0.8%
max 1.9% N/A -2.8% -2.4% -2.8%

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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. 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