Qt Creator very slow due to constant indexing with clangd
-
I use Qt Creator 7.0.2 for a mixed C/C+ project using CMake 3.20.6 (and Ninja as a generator) (and MinGW 7.30 64-bits as a main compiler), and it has been recently very slow due to constant indexing. It says almost at all times inthe bottom right "Indexing with clangd" and says it has anywhere between 1 and 4 files to index. This makes everything slow or frozen as it consumes a lot of CPU and seems to be blocking for everything in Qt Creator. This wasn't the case before, or ever in previous versions.
Any tips or hints as to what could cause this ? I can deactivate clangd parsing/indexing, but then I get no auto-complete or other project-parsing/indexing-dependent functionalities.
-
I use Qt Creator 7.0.2 for a mixed C/C+ project using CMake 3.20.6 (and Ninja as a generator) (and MinGW 7.30 64-bits as a main compiler), and it has been recently very slow due to constant indexing. It says almost at all times inthe bottom right "Indexing with clangd" and says it has anywhere between 1 and 4 files to index. This makes everything slow or frozen as it consumes a lot of CPU and seems to be blocking for everything in Qt Creator. This wasn't the case before, or ever in previous versions.
Any tips or hints as to what could cause this ? I can deactivate clangd parsing/indexing, but then I get no auto-complete or other project-parsing/indexing-dependent functionalities.
In Qt Creator 9 you can change the priority of the indexing threads for Clangd (a feature of Clangd 15, which we ship with Qt Creator 9). An updated Clangd might also fix the actual issue that it seems to have issues indexing your files in the first place.
You can only deactivate the global indexing for Clangd in the Qt Creator settings. Qt Creator then uses the global index from our built-in indexer, but completion etc from Clangd. Also, if you disable Clangd completely, Qt Creator falls back to the built-in code model, so you should at least get something.