This is an archive of the discontinued LLVM Phabricator instance.

[clang][deps] NFC: Speed up canonical context hash computation
ClosedPublic

Authored by jansvoboda11 on Aug 3 2023, 3:56 PM.

Details

Summary

This patch makes use of the infrastructure established in D157046 to speed up computation of the canonical context hash in the dependency scanner. This is somewhat hot code, since it's ran for all modules in the dependency graph of every TU.

I also tried an alternative approach that tried to avoid allocations as much as possible (essentially doing HashBuilder.add(Arg.toStringRef(ArgVec))), but that turned out to be slower than approach in this patch.

Note that this is not problematic in the same way command-line hashing used to be prior D143027. The lambda is now being called even for constant strings.

Depends on D157046.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Aug 3 2023, 3:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2023, 3:56 PM
Herald added a subscriber: ributzka. · View Herald Transcript
jansvoboda11 requested review of this revision.Aug 3 2023, 3:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2023, 3:56 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
benlangmuir accepted this revision.Aug 3 2023, 4:04 PM
This revision is now accepted and ready to land.Aug 3 2023, 4:04 PM