Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 4.2.0-rc1
Description
Opening any project with a *.ui file whose corresponding ui_*.h is not yet written to disk leads to slow libclang performance regarding reparse/completion in any file (also from other projects).
Reproduce by following these steps:
- Start Qt Creator within an environment containing LIBCLANG_TIMING=1 to get generate some debugging output.
- Open some project without any *.ui files, e.g. create a Qt Console Application from the wizard.
- Edit the opened main.cpp once (e.g. hit Enter at end) and wait some seconds until no more output is generated.
- Edit main.cpp again and it should generate
clangbackend.stderr: Reparsing /home/nik/work/testprojects/untitled2/main.cpp: 0.0920 (100.0%) 0.0080 (100.0%) 0.1000 (100.0%) 0.1010 (100.0%)
This is repeatable - for each edit a reparse happens.
- Load a project with *.ui files which was not yet build, e.g. create a Qt Widgets Application from the wizard and close the opened document because we are not interested in that one.
- Edit main.cpp again, this time it will precompile the preamble before each reparse:
clangbackend.stderr: Precompiling preamble: 1.0600 (100.0%) 0.0120 (100.0%) 1.0720 (100.0%) 1.0708 (100.0%) clangbackend.stderr: Reparsing /home/nik/work/testprojects/untitled2/main.cpp: 1.1520 (100.0%) 0.0160 (100.0%) 1.1680 (100.0%) 1.1700 (100.0%)
This is repeatable - for each edit the preamble is precompiled and a reparse happens.
In the output, the very last number is the wall clock time. "Precompiling preamble" is part of "Reparsing". Note that the reparses now are about 10x slower due to the extra preamble precompilation. - Close the second project or build it. Then, edit main.cpp again and see that parsing is fast again.