Page MenuHomePhabricator

[libclang] Add a flag to create the precompiled preamble on the first parse.
ClosedPublic

Authored by bkramer on Dec 14 2015, 3:51 AM.

Details

Summary

The current default is to create the preamble on the first reparse, aka
second parse. This is useful for clients that do not want to block when
opening a file because serializing the preamble takes a bit of time.
However, this makes the reparse much more expensive and that may be on the
critical path as it's the first interaction a user has with the source code.

YouCompleteMe currently optimizes for the first code interaction by parsing
the file twice when loaded. That's just unnecessarily slow and this flag
helps to avoid that. Sadly I don't see a way to test this as it only
affects performance.

Diff Detail

Repository
rL LLVM

Event Timeline

bkramer updated this revision to Diff 42702.Dec 14 2015, 3:51 AM
bkramer retitled this revision from to [libclang] Add a flag to create the precompiled preamble on the first parse..
bkramer updated this object.
bkramer added reviewers: doug.gregor, klimek.
bkramer added a subscriber: cfe-commits.
klimek accepted this revision.Dec 14 2015, 4:34 AM
klimek edited edge metadata.

lg

This revision is now accepted and ready to land.Dec 14 2015, 4:34 AM
doug.gregor edited edge metadata.Dec 14 2015, 10:55 AM

For reference, you can test this by setting the environment variable LIBCLANG_TIMING in your test, and checking that the string "Precompiling preamble" shows up on first parse.

bkramer updated this revision to Diff 42749.Dec 14 2015, 12:07 PM
bkramer edited edge metadata.

Add test case.

This revision was automatically updated to reflect the committed changes.