-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Consolidate rustdoc's lint passes into a single pass #104757
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
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 03dde7c3ac40ea6d2c1623c4d097e08166afc1b6 with merge ac8e12e0ba51bd025e996f86849e13b836d475bf... |
This should improve performance and simplify the code.
03dde7c
to
9eb8577
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 9eb8577 with merge 797475cf006080799e493a05d64b5bc60992c461... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (797475cf006080799e493a05d64b5bc60992c461): comparison URL. Overall result: no relevant changes - no action neededBenchmarking 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 Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. |
The performance shouldn't be impacted (as confirmed just above) but the code simplification is still nice to have. Considering it's changing some rustdoc cli flags, let's double check with the rest of the team first. cc @rust-lang/rustdoc |
Yes, lint passes are run stacked on each other, having multiple or single lint passes ought not to change performance |
fn visit_item(&mut self, item: &Item) { | ||
bare_urls::visit_item(self.cx, item); | ||
check_code_block_syntax::visit_item(self.cx, item); | ||
html_tags::visit_item(self.cx, item); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these start by computing the collapsed_doc_value
, it might save time to compute that once here and pass in an Option<&str>
for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think that's one way to unify passes: unify everything that needs the doc value
Interesting, I didn't know that! Where in the code does that happen? |
Somewhere in librustc_lint Basically the lint passes are run as a single Visitor, which then runs through a list of the relevant check_ function for each lint when it hits each node. |
Hmm, but these lint passes are defined in |
Oh, they operate on That would have been a bit concerning to me because the LintPass architecture handles lint levels (or, it used to) but turns out if you emit lints directly from the tcx it handles levels for you. Makes sense, in that case. We probably can make them get run the same way, though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should switch these from using clean::Crate to tcx directly at some point, but this seems like a step in the right direction.
@bors r=GuillaumeGomez,jyn514,Manishearth |
☀️ Test successful - checks-actions |
Finished benchmarking commit (1195b67): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
…meGomez,jyn514,Manishearth Consolidate rustdoc's lint passes into a single pass This should improve performance and simplify the code. r? `@GuillaumeGomez`
This should improve performance and simplify the code.
r? @GuillaumeGomez