- User Since
- Nov 22 2020, 2:16 AM (8 w, 18 h)
Nov 26 2020
I have also considered these problems, and here is some points of my view.
Consider llvm-project itself, textDocument/codeLens can be done in <500ms generally and <100ms if collect hierarchy is disabled in my notebook. Latency is significant in some rare case like Type.h which has too complex hierarchy relations. Meanwhile, vscode is smart to remember previous codelens's positions so the text rendering will not look too weird during long-time request. In fact, the biggest performance issue I find is that building AST when open a new file costs too much time, which makes textDocument/codeLens quite slow, as well as other action such as textDocument/documentSymbols. That's why I modified ClangdLSPServer.cpp to keep AST for recent closed files.
|file||line count||cost||cost (without hierarchy)|
|Decl.h||4599||213 ms||40 ms|
|Expr.h||6383||447 ms||61 ms|
|Type.h||7222||3765 ms||47 ms|