[Qt-creator] clangd parsing time

Eike Ziller Eike.Ziller at qt.io
Wed Nov 10 09:12:25 CET 2021



> On Nov 9, 2021, at 21:31, Adam Light <aclight at gmail.com> wrote:
> 
>> On Tue, Nov 9, 2021 at 6:27 AM Eike Ziller <Eike.Ziller at qt.io> wrote:
>> I can confirm on macOS, that Qt Creator in Qt Creator takes 2 1/2 hours to index, on a machine that takes 12 minutes to build it.
>> clangd uses 12 threads by default, but only 4 out of 8 cores. Turning up the number of "worker threads" does increase the number of threads used, but doesn't increase the cores/CPU used and doesn't make indexing faster.
>> 
>> The good thing is that the full indexing is only done once (cached per build directory), and further updates just index what has changed.
>> 
> Thanks. It seems like what I am seeing is more or less expected, I guess.

Well, expected in the current state of clangd, though I'd say that it is a bug (and the issue for clangd is still "open", not rejected).
Unfortunately it is something that we cannot directly fix in Qt Creator, though we can try to help the clangd people.

> In the end it took 3 hours 54 minutes to finish parsing my project. Since the parsing would need to be done separately for different configurations (e.g. debug and release) and possibly after changes to the build configuration, I wonder how useful using clangd will ever be. FWIW, I was exploring clangd due to slow parsing of our project from the clang code model, reported at https://bugreports.qt.io/browse/QTCREATORBUG-26327, but even the clang code model doesn't take almost 4 hours to parse the project.

To clarify a bit:

The non-clangd indexer is not based on libclang/llvm, it is our own, self-written indexer that we already had before the ClangCodeModel. libclang does not support indexing.

Even with clangd enabled in Qt Creator, we run our old indexer as a faster fallback solution until the clangd indexing has finished. So, so far the clangd indexing is just a "bonus" - even before it finishes, global searches etc are already enabled and done with our old indexer like without clangd, and after it finished the global searches use the more precise clangd indexer.

Br, Eike

-- 
Eike Ziller
Principal Software Engineer

The Qt Company GmbH
Erich-Thilo-Straße 10
D-12489 Berlin
eike.ziller at qt.io
http://qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Jouni Lintunen
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B



More information about the Qt-creator mailing list