Skip to content

rustdoc: Cleanup DocFragment #91034

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 3 commits into from
Nov 19, 2021
Merged

rustdoc: Cleanup DocFragment #91034

merged 3 commits into from
Nov 19, 2021

Conversation

camelid
Copy link
Member

@camelid camelid commented Nov 19, 2021

  • Remove unused DocFragment.line field
  • Avoid using Iterator::count() where possible

`count()` iterates over the whole collection. Using `len()` instead, or
`.next().is_none()` when comparing to zero, should be faster.
@camelid camelid added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. I-compiletime Issue: Problems and improvements with respect to compile times. labels Nov 19, 2021
@rust-highfive
Copy link
Contributor

r? @ollie27

(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 Nov 19, 2021
@camelid
Copy link
Member Author

camelid commented Nov 19, 2021

r? @jyn514

@rust-highfive rust-highfive assigned jyn514 and unassigned ollie27 Nov 19, 2021
@camelid
Copy link
Member Author

camelid commented Nov 19, 2021

@bors rollup=never

@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 Nov 19, 2021
@bors
Copy link
Collaborator

bors commented Nov 19, 2021

⌛ Trying commit a792234 with merge b98346f79d66ea8b1401c45ec592586c5973786f...

@jyn514
Copy link
Member

jyn514 commented Nov 19, 2021

r=me whether or not there are perf improvements

@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 Nov 19, 2021
@bors
Copy link
Collaborator

bors commented Nov 19, 2021

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

@rust-timer
Copy link
Collaborator

Queued b98346f79d66ea8b1401c45ec592586c5973786f with parent 548c108, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b98346f79d66ea8b1401c45ec592586c5973786f): comparison url.

Summary: This change led to large relevant mixed results 🤷 in compiler performance.

  • Small improvement in instruction counts (up to -0.4% on full builds of deeply-nested)
  • Large regression in instruction counts (up to 3.9% on incr-unchanged builds of deep-vector)

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.

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

@rustbot rustbot added perf-regression Performance regression. 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 Nov 19, 2021
@camelid
Copy link
Member Author

camelid commented Nov 19, 2021

Up to -0.36% on Serde instructions and =0.62% on Serde max-rss. Regressions are mostly noise.

cc @rylev (do you want me to still ping you when there are significant spurious results?)

@rustbot label -perf-regression

@rustbot rustbot removed the perf-regression Performance regression. label Nov 19, 2021
@camelid
Copy link
Member Author

camelid commented Nov 19, 2021

@bors r=jyn514 rollup=never

@bors
Copy link
Collaborator

bors commented Nov 19, 2021

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

jyn514 commented Nov 19, 2021

@bors r-

#91034 (comment)

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 19, 2021
@camelid
Copy link
Member Author

camelid commented Nov 19, 2021

@bors r=jyn514 rollup=never

@bors
Copy link
Collaborator

bors commented Nov 19, 2021

📌 Commit a40e7a8e785271d892333812032468ac2e1b3ef6 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. labels Nov 19, 2021
@rust-log-analyzer

This comment has been minimized.

We think `.as_str().lines().next().is_none()` should be equivalent to
`== kw::Empty`.

Co-authored-by: Joshua Nelson <github@jyn.dev>
@jyn514
Copy link
Member

jyn514 commented Nov 19, 2021

@bors r- ci is broken

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 19, 2021
@camelid
Copy link
Member Author

camelid commented Nov 19, 2021

@bors r=jyn514

@bors
Copy link
Collaborator

bors commented Nov 19, 2021

📌 Commit 7a4e2ce 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. labels Nov 19, 2021
@bors
Copy link
Collaborator

bors commented Nov 19, 2021

⌛ Testing commit 7a4e2ce with merge a77da2d...

@bors
Copy link
Collaborator

bors commented Nov 19, 2021

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 19, 2021
@bors bors merged commit a77da2d into rust-lang:master Nov 19, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 19, 2021
@camelid camelid deleted the docfragment branch November 19, 2021 22:21
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a77da2d): comparison url.

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

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

@rustbot label: -perf-regression

@jyn514
Copy link
Member

jyn514 commented Nov 19, 2021

Max-rss improvement on this is actually pretty decent, between -.8% and -1.4% :)

@jyn514 jyn514 added the I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. label Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. I-compiletime Issue: Problems and improvements with respect to compile times. 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