D80025 introduced a performance regression: in some cases, it makes
clang-tidy readability-container-size-empty ~80x slower (running on an internal
huge TU, before that patch 12s vs after 950s).
after this patch, we go back to 12s.
Differential D82771
[ASTMatcher] Fix a performance regression: memorize the child match. hokein on Jun 29 2020, 7:43 AM. Authored by
Details D80025 introduced a performance regression: in some cases, it makes after this patch, we go back to 12s.
Diff Detail
Event TimelineComment Actions In what situation are we calling child matchers repeatedly with the same matcher on the same node?
Comment Actions Ah, so this is when we go hasDeclaration. I'm wondering whether what we really want to memoize are matchers that go across the AST, like hasType, hasDeclaration, etc, where we can expect a linear number of nodes hitting that matcher. hasChild specifically seems weird to memoize when we don't memoize other has matchers. Comment Actions (I can't quite follow the original reason for disabling memoization in the non-recursive case, so this seems reasonable but going to leave that to Manuel who knew the argument)
Comment Actions LG
|
Here and below: s/memorize/memoize/