This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objcopy] Improve performance of long pattern lists
ClosedPublic

Authored by MaskRay on Jun 30 2021, 11:31 AM.

Details

Summary

Some users use a long list of patterns (PR50404) and O(|patterns|*|symbols|) can
be too slow. Such usage typically does not use --regex or --wildcard, we can use
a DenseSet<CachedHashStringRef> to optimize name lookups.

Diff Detail

Event Timeline

MaskRay created this revision.Jun 30 2021, 11:31 AM
MaskRay requested review of this revision.Jun 30 2021, 11:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2021, 11:31 AM
jhenderson accepted this revision.Jul 1 2021, 12:25 AM

LGTM! Out of interest, what sort of performance difference does this make?

This revision is now accepted and ready to land.Jul 1 2021, 12:25 AM

@bcain , could you check whether this addresses the performance issue for you?

@bcain , could you check whether this addresses the performance issue for you?

@bcain Ping?

I am not @bcain, but I tested this patch locally and can confirm it addressed the performance issue (of using a large list of symbols) for me.

I will update the bug. I think this patch solves the issue.

bcain added a comment.Jul 12 2021, 8:05 AM

@bcain , could you check whether this addresses the performance issue for you?

@bcain Ping?

Yes, it does. Thank you very much!

This revision was automatically updated to reflect the committed changes.