This is an archive of the discontinued LLVM Phabricator instance.

[clang][modules] NFC: Only sort interesting identifiers
ClosedPublic

Authored by jansvoboda11 on May 12 2023, 4:05 PM.

Details

Summary

In 9c254184 ASTWriter stopped writing identifiers that are not interesting. Taking it a bit further, we don't need to sort the whole identifier table, just the interesting identifiers. This reduces the size of sorted vector from ~10k (including lots of builtins) to 2 (__VA_ARGS__ and __VA_OPT__) in a typical Xcode project, improving clang-scan-deps performance.

Diff Detail

Event Timeline

jansvoboda11 created this revision.May 12 2023, 4:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2023, 4:05 PM
Herald added a subscriber: ributzka. · View Herald Transcript
jansvoboda11 requested review of this revision.May 12 2023, 4:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2023, 4:05 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jansvoboda11 edited the summary of this revision. (Show Details)May 12 2023, 4:06 PM
ributzka added inline comments.May 15 2023, 11:24 AM
clang/lib/Serialization/ASTWriter.cpp
3646

Would it make sense to reduce the size of the SmallVector too?

benlangmuir accepted this revision.May 15 2023, 11:28 AM
This revision is now accepted and ready to land.May 15 2023, 11:28 AM
jansvoboda11 added inline comments.May 15 2023, 11:40 AM
clang/lib/Serialization/ASTWriter.cpp
3646

That would most likely regress serialization of real (non-scanning) PCMs, so I'd prefer to leave this be.

This revision was landed with ongoing or failed builds.May 15 2023, 1:29 PM
This revision was automatically updated to reflect the committed changes.