This is an archive of the discontinued LLVM Phabricator instance.

[index] Fix performance regression with indexing macros
ClosedPublic

Authored by benlangmuir on Jun 15 2021, 7:41 PM.

Details

Reviewers
arphaman
Summary

When using FileIndexRecord with macros, symbol references can be seen out of source order, which was causing a regression to insert the symbols into a vector. Instead, we now lazily sort the vector. The impact is small on most code, but in very large files with many macro references (M) near the beginning of the file followed by many decl references (D) it was O(M*D). A particularly bad protobuf-generated header was observed with a 100% regression in practice.

rdar://78628133

Diff Detail

Event Timeline

benlangmuir requested review of this revision.Jun 15 2021, 7:41 PM
benlangmuir created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2021, 7:41 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
benlangmuir edited the summary of this revision. (Show Details)Jun 15 2021, 7:42 PM
arphaman accepted this revision.Jun 16 2021, 10:07 AM

Thanks, LGTM!

This revision is now accepted and ready to land.Jun 16 2021, 10:07 AM