This is showing up on our profiles with ~100ms contribution @95th% for
buildAST latencies.
The patch is unlikely to address it all, but should help with some low-hanging
fruit.
Details
- Reviewers
sammccall - Commits
- rG62a090f958ce: [clangd] Initialize clang-tidy modules only once
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/ParsedAST.cpp | ||
---|---|---|
478–483 | as written this creates a global destructor instead, prefer heap-allocating and never freeing (the static variable should be a pointer or non-lifetime-extending reference) | |
clang-tools-extra/clangd/TidyProvider.cpp | ||
300 | same here, avoid the destructor | |
300 | nit: call this DefaultOpts, as it's in general not the opts we're calculating | |
305 | Inverting the if(Provider) check isn't clearer IMO, and it's also not an optimization (return Opts is a copy, vs NewOpts = Opts is a copy + return NewOpts is a NVRO no-op). Up to you, but I prefer the previous formulation (with the extra copy of defaultopts added at the top) |
as written this creates a global destructor
instead, prefer heap-allocating and never freeing (the static variable should be a pointer or non-lifetime-extending reference)