[clang-tools-extra] [clangd] Extract to Function: mark unmodified captured parameters const (PR #225666)
Christian Kandeler via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 23 06:18:05 PDT 2026
ckandeler wrote:
> Sorry, yes, `prepare()` is unaffected, but performance degradation is still here and sits in `apply()`. Uncached AST matchers in a nested loop is a noticeable performance hazard. For now I see that we get extra `O(S*V*AST)` complexity: for each of the `V` captured variables and `S` root statements, a new `ExprMutationAnalyzer` is instantiated inside the inner loop (this also destroys `ExprMutationAnalyzer`s memoization cache on every iteration).
The instantiation is now outside the loop.
> Without `clang-tidy` linkage into `clangd` (we have a build option for this), `clangd` has no dependency on `clangAnalysis`. So, I except the binary size increase (in case when we don't link `clang-tidy` into `clangd`). So, we need some numbers to be sure that the size change is insignificant.
I'll come back with some numbers shortly.
https://github.com/llvm/llvm-project/pull/225666
More information about the cfe-commits
mailing list