Skip to content

[String] String-from-whole-Substring fast-path. #21072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2018

Conversation

milseman
Copy link
Member

@milseman milseman commented Dec 6, 2018

Add in a fast-path for Strings created from Substring which covers the
entire String. Put String-from-Substring behind a non-inlinable
resilience barrier for future flexibility.

Add in a fast-path for Strings created from Substring which covers the
entire String. Put String-from-Substring behind a non-inlinable
resilience barrier for future flexibility.
@milseman
Copy link
Member Author

milseman commented Dec 6, 2018

@swift-ci please benchmark

@milseman
Copy link
Member Author

milseman commented Dec 6, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Dec 6, 2018

Build comment file:

Performance: -O

TEST OLD NEW DELTA RATIO
Regression
CharacterLiteralsLarge 97 108 +11.3% 0.90x
IterateData 1396 1509 +8.1% 0.93x
Improvement
StringFromLongWholeSubstring 80 11 -86.2% 7.27x
StringFromLongWholeSubstringGeneric 91 22 -75.8% 4.14x
Breadcrumbs.CopyUTF16CodeUnits.Mixed 68 55 -19.1% 1.24x
FlattenListLoop 4336 3970 -8.4% 1.09x
MapReduceAnyCollection 398 369 -7.3% 1.08x
FlattenListFlatMap 6864 6398 -6.8% 1.07x (?)
MapReduce 425 397 -6.6% 1.07x

Code size: -O

TEST OLD NEW DELTA RATIO
Improvement
StringEdits.o 13063 11967 -8.4% 1.09x
Substring.o 20263 19167 -5.4% 1.06x
CSVParsing.o 31641 30257 -4.4% 1.05x
WordCount.o 44211 43115 -2.5% 1.03x
StringComparison.o 44486 43390 -2.5% 1.03x

Performance: -Osize

TEST OLD NEW DELTA RATIO
Regression
IterateData 1353 1499 +10.8% 0.90x
Improvement
StringFromLongWholeSubstring 85 11 -87.1% 7.73x
StringFromLongWholeSubstringGeneric 90 23 -74.4% 3.91x
Breadcrumbs.CopyUTF16CodeUnits.Mixed 68 55 -19.1% 1.24x
InsertCharacterEndIndexNonASCII 59 55 -6.8% 1.07x (?)

Code size: -Osize

TEST OLD NEW DELTA RATIO
Improvement
CSVParsing.o 31977 30697 -4.0% 1.04x

Performance: -Onone

TEST OLD NEW DELTA RATIO
Improvement
StringFromLongWholeSubstring 81 12 -85.2% 6.75x
StringFromLongWholeSubstringGeneric 103 29 -71.8% 3.55x
ArrayOfPOD 860 775 -9.9% 1.11x (?)

Code size: -swiftlibs

TEST OLD NEW DELTA RATIO
Improvement
libswiftNetwork.dylib 163840 159744 -2.5% 1.03x
How to read the data The tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.

If you see any unexpected regressions, you should consider fixing the
regressions before you merge the PR.

Noise: Sometimes the performance results (not code size!) contain false
alarms. Unexpected regressions which are marked with '(?)' are probably noise.
If you see regressions which you cannot explain you can try to run the
benchmarks again. If regressions still show up, please consult with the
performance team (@eeckstein).

Hardware Overview
  Model Name: Mac Pro
  Model Identifier: MacPro6,1
  Processor Name: 12-Core Intel Xeon E5
  Processor Speed: 2.7 GHz
  Number of Processors: 1
  Total Number of Cores: 12
  L2 Cache (per Core): 256 KB
  L3 Cache: 30 MB
  Memory: 64 GB
--------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants