This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho][NFC] Remove redundant StringRef construction
ClosedPublic

Authored by BertalanD on Jul 21 2022, 2:39 AM.

Details

Reviewers
int3
thakis
Group Reviewers
Restricted Project
Commits
rG888d0a5ef259: [lld-macho][NFC] Remove redundant StringRef construction
Summary

It's only used in one branch, so we were unnecessarily calculating the
length of many symbol names.

Tiny speedup when linking chromium_framework on my M1 Mac mini:

x before.txt
+ after.txt

    N           Min           Max        Median           Avg        Stddev
x  10     3.9917109        4.0418     4.0318099     4.0203902   0.021459873
+  10      3.944725      4.053988     3.9708955     3.9825602   0.037257609
Difference at 95.0% confidence
	-0.03783 +/- 0.0285663
	-0.940953% +/- 0.710536%
	(Student's t, pooled s = 0.0304028)

Diff Detail

Event Timeline

BertalanD created this revision.Jul 21 2022, 2:39 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 21 2022, 2:39 AM
BertalanD requested review of this revision.Jul 21 2022, 2:39 AM
int3 accepted this revision.Jul 21 2022, 5:42 AM
int3 added a subscriber: int3.

Nice find!

This revision is now accepted and ready to land.Jul 21 2022, 5:42 AM
thakis accepted this revision.Jul 21 2022, 5:58 AM
thakis added a subscriber: thakis.

Thanks :)

Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 6:37 AM