This is an archive of the discontinued LLVM Phabricator instance.

[clangd] reuse preambles from other files when possible
AbandonedPublic

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

Details

Reviewers
sammccall
Summary

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
qchateau updated this revision to Diff 429470.May 14 2022, 11:24 AM

Resolve conflicts, fix formatting, simplify patch

Herald added a project: Restricted Project. · View Herald TranscriptMay 14 2022, 11:24 AM
qchateau updated this revision to Diff 429478.May 14 2022, 12:03 PM

Small correction

qchateau abandoned this revision.May 14 2022, 12:23 PM
nridge added a comment.Jun 6 2022, 1:33 AM

@qchateau How should I interpret the abandoning of this patch -- did you run into a problem with the approach, or just don't have the time / interest to pursue it further?

@nridge after rebasing this change for several months, I find it less and less useful. It seems both clangd and the IDE I'm using are making significant improvements that make this changes less and less impactful.
I closed this revision as I feel that it now passed the threshold where the annoyance of maintaining it is greater than the return I'm getting from it