Skip to content

Optimize documentation lints **a lot** (2/2) (7.5% -> 1%) #14870

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

Conversation

blyxyas
Copy link
Member

@blyxyas blyxyas commented May 22, 2025

So, after #14693 was merged,
this is the continuation. It performs some optimizations on Fragments::span
, makes it so we don't call it so much, and makes a 85.75% decrease (7.51% -> 1.07%)
in execution samples of source_span_for_markdown_range and a 6.39% -> 0.88%
for core::StrSearcher::new. Overall a 13.11% icount decrase on docs-heavy crates.

Benchmarked mainly on regex-1.10.5.

@rustbot label +performance-project

This means that currently our heaviest function is rustc_middle::Interners::intern_ty, even
for documentation-heavy crates

Along with #14693, this makes the lint a 7% of what it was before and makes it so that even in the most doc-heavy of crates it's not an issue.

changelog:Optimize documentation lints by a further 85%

r? @Jarcho

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties performance-project For issues and PRs related to the Clippy Performance Project labels May 22, 2025
@rustbot

This comment has been minimized.

@blyxyas blyxyas force-pushed the optimize-doc-lints-electric-bogaloo branch 2 times, most recently from 61f5c20 to 58e4574 Compare May 22, 2025 13:36
@blyxyas blyxyas changed the title Optimize documentation lints **a lot** (2/2) Optimize documentation lints **a lot** (2/2) (7.5% -> 1%) May 22, 2025
Copy link
Contributor

@Jarcho Jarcho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for chasing all these perf problems.

One style nit, but it's fine either way.

@blyxyas blyxyas force-pushed the optimize-doc-lints-electric-bogaloo branch from 58e4574 to 71090fe Compare May 23, 2025 17:36
So, after rust-lang#14693 was merged,
this is the continuation. It performs some optimizations on `Fragments::span`
, makes it so we don't call it so much, and makes a 85.75% decrease (7.51% -> 10.07%)
in execution samples of `source_span_for_markdown_range` and a 6.39% -> 0.88%
for `core::StrSearcher::new`. Overall a 13.11% icount decrase on docs-heavy crates.

Benchmarked mainly on `regex-1.10.5`.

This means that currently our heaviest function is `rustc_middle::Interners::intern_ty`, even
for documentation-heavy crates

Co-authored-by: Roope Salmi <[email protected]>
@blyxyas blyxyas force-pushed the optimize-doc-lints-electric-bogaloo branch from 71090fe to 4a7598f Compare May 23, 2025 17:46
@Jarcho Jarcho added this pull request to the merge queue May 24, 2025
Merged via the queue into rust-lang:master with commit 1029572 May 24, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance-project For issues and PRs related to the Clippy Performance Project S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants