This is an archive of the discontinued LLVM Phabricator instance.

[RFC] Add and sort decl to maintain order instead of inserting in order
ClosedPublic

Authored by kuganv on May 3 2022, 4:22 AM.

Details

Summary

ASTWriter::associateDeclWithFile shows a lot in clangd perf profile due to O(n^2) behaviour in insertion of DeclIDs in SortedFileDeclIDs. Instead of doing that, this patch just appends it to the DeclIDs vector and sorts them at the end.

Diff Detail

Event Timeline

kuganv created this revision.May 3 2022, 4:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2022, 4:23 AM
kuganv requested review of this revision.May 3 2022, 4:23 AM
akyrtzi accepted this revision.May 3 2022, 8:51 AM
This revision is now accepted and ready to land.May 3 2022, 8:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2022, 9:10 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript