This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Simplify DeduplicatedCStringSection::finalizeContents. NFC
ClosedPublic

Authored by MaskRay on Jan 13 2022, 9:50 PM.

Details

Summary

Tail merge is slow and of low value. With regular string deduplication, we can
just use the return value of StringTableBuilder::add.

There is no noticeable performance increase because without deduplication
__cstring is quite small (7.6MiB for chromium_framework).


I tried an ELF port style parallel algorithm (https://reviews.llvm.org/P8275), but did not see an improvement
when linking chromium_framework.

Diff Detail

Event Timeline

MaskRay created this revision.Jan 13 2022, 9:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2022, 9:50 PM
MaskRay requested review of this revision.Jan 13 2022, 9:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2022, 9:50 PM
MaskRay edited the summary of this revision. (Show Details)Jan 13 2022, 10:06 PM
int3 accepted this revision.EditedJan 14 2022, 1:02 PM
int3 added a subscriber: int3.

Could you include in the commit message the size % change (edit: and the change in link time too) when linking chromium_framework?

This revision is now accepted and ready to land.Jan 14 2022, 1:02 PM
MaskRay added a comment.EditedJan 14 2022, 1:08 PM

Could you include in the commit message the size % change when linking chromium_framework?

There is no observable difference, likely because the string section size is small (__cstring 007a31a1) without --deduplicate-literals.

ld64 does not concatenate debug info so the biggest bottleneck (.debug_str) on ELF is not a problem for Mach-O...

MaskRay edited the summary of this revision. (Show Details)Jan 14 2022, 1:11 PM