Description
Previous ID | SR-9184 |
Radar | None |
Original Reporter | @milseman |
Type | Task |
Attachment: Download
Additional Detail from JIRA
Votes | 0 |
Component/s | Standard Library |
Labels | Task, Performance |
Assignee | @milseman |
Priority | Medium |
md5: 5e76fa6a2d0620628262e8b5de6feea2
Sub-Tasks:
- SR-9192 Flatten/rework normalized code unit iterator
- SR-9212 String comparison binary-divergence fast-path not triggering
- SR-9270 Tweak String comparison inlinability
- SR-9272 Potential invalid benchmarks (used to skip allocations)
- SR-9287 Poor codegen for String iteration
- SR-9427 CharacterLiteralsSmall: Failure to constant-fold release
Issue Description:
UTF-8 String comes a lot of wins, but some current regressions:
This is an ☂️ bug, see Sub-Tasks below.
Current status of this set of regressions. Note this is only a listing of what were regressions when the PR was merged; omitted benchmarks exhibited improvement:
-
To fix in 5.0:
-
Flattened normalized iterator (https://bugs.swift.org/browse/SR-9192):
-
StringComparison_abnormal
-
StringHashing_abnormal
-
StringHashing_zalgo
-
-
MapReduceString (https://bugs.swift.org/browse/SR-9460)
-
-
5.0 currently has parity with 4.2 performance:
-
StringFromLongWholeSubstringGeneric
-
StringComparison_fastPrenormal
-
WordCountUniqueASCII
-
RemoveWhereQuadraticString
-
StringWordBuilder
-
StringHashing_ascii
-
-
5.0 is faster than 4.2:
-
SubstringComparble
-
StringFromLongWholeSubstring
-
StringComparison_latin1
-
StringWalk
-
StringEqualPointerComparison
-
Dictionary3
-
StringWordBuilderReservingCapacity
-
StringHasPrefixUnicode
-
Dictionary
-
RemoveWhereFilterString
-
StringInterpolationManySmallSegments
-
StringMatch
-
Join
-
StringBuilderLong
-
RomanNumbers
-
-
Resolved for Swift 5.0:
-
Chars2: We're happy with the size/speed tradeoff
- While still slower than 4.2, this is now is significantly smaller in code size (~7x smaller)
-
-
Post Swift 5.0:
-
Native Grapheme Breaking (https://bugs.swift.org/browse/SR-9423)
-
StringHasSuffixUnicode
-
CSVParsing2 (improved)
-
CharacterPropertiesStashedMemo
-
-
StrComplexWalk (https://bugs.swift.org/browse/SR-9424)
-
OpenClose (improved, further is https://bugs.swift.org/browse/SR-9425)
-
CharacterLiteralsSmall (https://bugs.swift.org/browse/SR-9427)
-
SortStringsUnicode (improved, further is https://bugs.swift.org/browse/SR-9432)
-
Dictionary2 (https://bugs.swift.org/browse/SR-9438)
-
Calculator (improved, further is https://bugs.swift.org/browse/SR-9440)
-
Every single one of these extracted and merged into a single script file normalized to around 1 second each: https://gist.github.com/milseman/737d74fd4a6817432b3b5f18c34d416d