Page MenuHomePhabricator

[clangd] reuse preambles from other files when possible
Needs ReviewPublic

Authored by qchateau on Oct 27 2021, 1:33 PM.



Keep a store of the preambles of all opened filed, plus
a configurable number of previously used preambles (default 1).
When building the AST for a TU, if the preamble for this
TU is not yet built, look through the stored premables
to find the best compatible preamble and use this
preamble to speed-up the AST build.

Diff Detail

Event Timeline

qchateau created this revision.Oct 27 2021, 1:33 PM
qchateau requested review of this revision.Oct 27 2021, 1:33 PM

This is a revisit of D97417 which is a bit out of date and fell into oblivion.
I've been using a forked version of clangd including this change for months on my day-to-day work and it does significantly improve my experience.
Some numbers showing the kind of improvement you can expect from this change can be found in D97417, they are still relevant.

nridge added a subscriber: nridge.Oct 31 2021, 9:39 PM