D18551: clang: Create preamble only on second parse
noreply at phabricator.kde.org
Mon Jan 28 10:07:01 GMT 2019
mwolff requested changes to this revision.
mwolff added a comment.
This revision now requires changes to proceed.
it was measured back then:
Author: Sven Brauch <mail at svenbrauch.de>
Date: Wed Jul 26 00:49:18 2017 +0200
clang: fix precompiled preamble cache misses
We were a) passing in a wrong file size, and b) a different set of unsaved
files on building the translation unit as compared to invoking completion.
This resulted in the precompiled preamble being rebuilt every single time.
On my test file, time spent in clang_codeCompleteAt goes down from ~700ms
to ~12ms with this change after the project is fully parsed.
It still doesn't work in header files at all.
Differential Revision: https://phabricator.kde.org/D6905
Maybe the correct fix would be to check if the document is currently open, and if so, directly create the preamble on first parse. If the document isn't open yet, then we don't need to create the preamble yet.
Note that this also needs to work properly when we reparse for code completion, that must create the preamble directly.
As-is, this patch is a no-go, but I would like to see more work in this area. We should probably also create a proper benchmark for this while at it.
To: aaronpuchert, #kdevelop, mwolff, brauch, rjvbb
Cc: rjvbb, kdevelop-devel, glebaccon, hase, antismap, iodelay, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KDevelop-devel