[perf] rustdoc: Perform less work when cleaning middle::ty parenthesized generic args#132886
Merged
bors merged 1 commit intorust-lang:masterfrom Nov 13, 2024
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CC #132697. I presume the perf regression it caused (if real) boils down to query invocation overhead, namely of
def_kind&trait_defas 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_argsunconditionally insideclean_middle_generic_args_with_constraintseven though we didn't actually use its result for parenthesized generic args (Trait(...) -> ...).Now, we only call
clean_middle_generic_argswhen necessary. Lastly, I've simplifiedclean_middle_generic_args_with_constraints.r? ghost