We can use this technique to take preamble indexing off the critical path on startup.
Details
- Reviewers
- None
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
120 ms | x64 debian > LLVM.Bindings/Go::go.test |
Event Timeline
@kadircet FYI this demonstrates how to extend the lifetime of the preamble AST beyond building the preamble, which would allow us to take preamble indexing off the critical path.
It's pretty hacky, but the doc comments on CompilerInstance more or less suggest this sort of thing!
In reality I imagine this looking more like: pass the whole CompilerInstance to the PreambleCallback, and have ClangdServer do the lifetime extension and throw the AliveAST struct onto a queue.
This ends up resembling https://reviews.llvm.org/D115232 a little bit, and they should share queues I think. So maybe I shouldn't develop this further until that one lands in some form.
When you say "take preamble indexing off the critical path on startup", do you mean the first time a file is opened in general? Or is this specific to startup somehow?