This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Optimize misc-confusable-identifiers
ClosedPublic

Authored by PiotrZSL on May 21 2023, 2:07 PM.

Details

Summary

Main performance issue in this check were caused by many
calls to getPrimaryContext and constant walk up to declaration
contexts using getParent. Also there were issue with forallBases
that is slow.

Profiled with perf and tested on open-source project Cataclysm-DDA.
Before changes check took 27320 seconds, after changes 3682 seconds.
That's 86.5% reduction. More optimizations are still possible in this
check.

Diff Detail

Event Timeline

PiotrZSL created this revision.May 21 2023, 2:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 21 2023, 2:07 PM
Herald added a subscriber: xazax.hun. · View Herald Transcript
PiotrZSL requested review of this revision.May 21 2023, 2:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 21 2023, 2:07 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Memoizing the calls to getPrimaryContext()... LGTM!

This revision is now accepted and ready to land.May 26 2023, 12:04 AM
This revision was automatically updated to reflect the committed changes.