-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
[perf] rustdoc: Perform less work when cleaning middle::ty parenthesized generic args #132886
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…s, r=<try> [perf] rustdoc: Perform less work when cleaning parenthesized generic args CC rust-lang#132697. I presume the perf regression it caused (if real) boils down to query invocation overhead (namely, of `def_kind` & `trait_def`). I won't address that because it would worsen the clean middle API. So I'm simply trying to attack some low-hanging fruits in the vicinity. r? ghost
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (66ae3a1): comparison URL. Overall result: ✅ improvements - 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 is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -0.1%, secondary 0.7%)This 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.
CyclesResults (secondary -2.4%)This 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 786.53s -> 785.607s (-0.12%) |
e51bfa6
to
0cebb35
Compare
@@ -112,7 +112,6 @@ pub(crate) fn clean_middle_generic_args<'tcx>( | |||
return None; | |||
} | |||
|
|||
// Elide internal host effect args. |
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.
Outdated since #131985
2/5 benchmarks spurious (not a doc profile). corrected perf summary:
r? rustdoc |
0cebb35
to
4660316
Compare
When the PR is ready for you, please run the perf check:
|
This comment has been minimized.
This comment has been minimized.
Oh, nothing really changed with my two force-pushes, I only renamed a variable 😅 |
Oh I don't judge, you can do as many renamings as you want. 🤣 |
Right, it's ready, that's what I meant to say above. I might come back to #132697's regression but for now, I won't due to time constraints. |
@bors r=GuillaumeGomez |
☀️ Test successful - checks-actions |
Finished benchmarking commit (ec239b8): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowOur benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -0.8%, secondary 3.0%)This 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.
CyclesResults (secondary -2.2%)This 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 784.378s -> 786.527s (0.27%) |
Compile time regressions on a rustdoc change? I don't think so, perf bot. @rustbot label: +perf-regression-triaged (these should stabilize in the next merge, hopefully, so let's re-check later) |
CC #132697. I presume the perf regression it caused (if real) boils down to query invocation overhead, namely of
def_kind
&trait_def
as we don't seem to be decoding more often from the crate metadata.I won't try the obvious and reduce the amount of query calls by threading information via params as that would render the code awkward.
So instead I'm simply trying to attack some low-hanging fruits in the vicinity.
Previously, we would
clean_middle_generic_args
unconditionally insideclean_middle_generic_args_with_constraints
even though we didn't actually use its result for parenthesized generic args (Trait(...) -> ...
).Now, we only call
clean_middle_generic_args
when necessary. Lastly, I've simplifiedclean_middle_generic_args_with_constraints
.r? ghost