Skip to content

Conversation

lorentey
Copy link
Member

@lorentey lorentey commented Dec 3, 2018

This adds Substring to #20893, hopefully improving benchmarks.

@lorentey
Copy link
Member Author

lorentey commented Dec 3, 2018

@swift-ci benchmark

@lorentey
Copy link
Member Author

lorentey commented Dec 3, 2018

@swift-ci smoke test

@lorentey
Copy link
Member Author

lorentey commented Dec 3, 2018

cc @airspeedswift

@swift-ci
Copy link
Contributor

swift-ci commented Dec 3, 2018

Build comment file:

Performance: -O

TEST OLD NEW DELTA RATIO
Regression
StringMatch 8880 44056 +396.1% 0.20x
RomanNumbers 73351 200994 +174.0% 0.36x
CSVParsing2 2546 3184 +25.1% 0.80x
Improvement
Breadcrumbs.CopyUTF16CodeUnits.Mixed 68 55 -19.1% 1.24x
Breadcrumbs.CopyUTF16CodeUnits.ASCII 20 18 -10.0% 1.11x
StringEqualPointerComparison 628 571 -9.1% 1.10x
ArrayAppendAsciiSubstring 15967 14598 -8.6% 1.09x
Dictionary4 265 244 -7.9% 1.09x
Breadcrumbs.UTF16ToIdx.longMixed 389 361 -7.2% 1.08x

Code size: -O

TEST OLD NEW DELTA RATIO
Regression
CSVParsing.o 31577 33709 +6.8% 0.94x
StringMatch.o 4430 4590 +3.6% 0.97x
StringEdits.o 12935 13231 +2.3% 0.98x
ArrayAppend.o 39272 40000 +1.9% 0.98x
Substring.o 18215 18415 +1.1% 0.99x

Performance: -Osize

TEST OLD NEW DELTA RATIO
Regression
StringMatch 9618 43080 +347.9% 0.22x
RomanNumbers 75717 224346 +196.3% 0.34x
CSVParsing2 2546 3249 +27.6% 0.78x
Improvement
Breadcrumbs.CopyUTF16CodeUnits.Mixed 67 55 -17.9% 1.22x
Breadcrumbs.CopyUTF16CodeUnits.ASCII 20 18 -10.0% 1.11x
Breadcrumbs.UTF16ToIdxRange.longMixed 122 110 -9.8% 1.11x
StringEqualPointerComparison 628 571 -9.1% 1.10x
Breadcrumbs.UTF16ToIdx.longMixed 389 362 -6.9% 1.07x

Code size: -Osize

TEST OLD NEW DELTA RATIO
Regression
StringMatch.o 4393 4721 +7.5% 0.93x
CSVParsing.o 32001 34197 +6.9% 0.94x
RomanNumbers.o 5630 5734 +1.8% 0.98x
StringEdits.o 11982 12150 +1.4% 0.99x

Performance: -Onone

TEST OLD NEW DELTA RATIO
Regression
CSVParsing2 4917 8193 +66.6% 0.60x
StringMatch 55201 87642 +58.8% 0.63x
SuffixArrayLazy 40530 53167 +31.2% 0.76x
DropLastArrayLazy 40552 52928 +30.5% 0.77x
SuffixCountableRangeLazy 44684 57372 +28.4% 0.78x
DropFirstCountableRangeLazy 135045 171107 +26.7% 0.79x
PrefixArrayLazy 131651 159851 +21.4% 0.82x
DropFirstArrayLazy 123214 141562 +14.9% 0.87x
RomanNumbers 2802799 3122468 +11.4% 0.90x
SuffixAnyCollectionLazy 69018 76450 +10.8% 0.90x
DropFirstAnyCollectionLazy 209699 228042 +8.7% 0.92x
Improvement
ArrayAppendAsciiSubstring 50619 39749 -21.5% 1.27x
ArrayAppendLatin1Substring 50874 39994 -21.4% 1.27x
ArrayAppendUTF16Substring 50724 39996 -21.1% 1.27x
ArrayOfPOD 859 782 -9.0% 1.10x (?)
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
--------------

@lorentey
Copy link
Member Author

lorentey commented Dec 3, 2018

D'oh, it actually made them worse.

@CodaFi
Copy link
Contributor

CodaFi commented Nov 18, 2019

Hm, let's try again shall we?

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Performance: -O

Regression OLD NEW DELTA RATIO
StringMatch 7500 39800 +430.7% 0.19x
FindString.Loop1.Substring 816 2806 +243.9% 0.29x
FindString.Rec3.Substring 244 765 +213.5% 0.32x
RomanNumbers2 647 2015 +211.4% 0.32x
FindString.Rec3.String 210 523 +149.0% 0.40x
CSVParsing.Char 440 993 +125.7% 0.44x
CSVParsing.UTF16 60 105 +75.0% 0.57x
CSVParsing.UTF8 61 70 +14.8% 0.87x
FlattenListFlatMap 7464 8360 +12.0% 0.89x (?)
ArrayAppendUTF16Substring 16056 17352 +8.1% 0.93x (?)
FlattenListLoop 4453 4812 +8.1% 0.93x (?)
Array2D 7232 7808 +8.0% 0.93x
RemoveWhereSwapInts 65 70 +7.7% 0.93x
 
Improvement OLD NEW DELTA RATIO
Data.hash.Empty 77 71 -7.8% 1.08x (?)
DataSetCountSmall 148 137 -7.4% 1.08x
StringComparison_fastPrenormal 1060 990 -6.6% 1.07x (?)
ObjectiveCBridgeStringHash 76 71 -6.6% 1.07x (?)

Code size: -O

Regression OLD NEW DELTA RATIO
CSVParsing.o 57756 61156 +5.9% 0.94x
StringMatch.o 4752 4866 +2.4% 0.98x
 
Improvement OLD NEW DELTA RATIO
FindStringNaive.o 10979 10691 -2.6% 1.03x
ArrayAppend.o 37255 36439 -2.2% 1.02x

Performance: -Osize

Regression OLD NEW DELTA RATIO
StringMatch 8300 43100 +419.3% 0.19x
FindString.Loop1.Substring 816 2815 +245.0% 0.29x
FindString.Rec3.Substring 247 768 +210.9% 0.32x
RomanNumbers2 636 1975 +210.5% 0.32x
FindString.Rec3.String 215 529 +146.0% 0.41x
CSVParsing.Char 437 1020 +133.4% 0.43x
CSVParsing.UTF16 62 107 +72.6% 0.58x
CSVParsing.UTF8 60 66 +10.0% 0.91x (?)
EqualStringSubstring 40 44 +10.0% 0.91x
StringComparison_nonBMPSlowestPrenormal 1490 1620 +8.7% 0.92x
EqualSubstringString 39 42 +7.7% 0.93x
 
Improvement OLD NEW DELTA RATIO
DataSetCountSmall 157 140 -10.8% 1.12x
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 96500 88500 -8.3% 1.09x (?)
Data.hash.Empty 77 71 -7.8% 1.08x (?)
ObjectiveCBridgeStubNSDateRefAccess 400 371 -7.2% 1.08x (?)
ObjectiveCBridgeStringHash 76 71 -6.6% 1.07x (?)

Code size: -Osize

Regression OLD NEW DELTA RATIO
StringMatch.o 4572 5012 +9.6% 0.91x
CSVParsing.o 54840 59384 +8.3% 0.92x
ArrayAppend.o 29983 30703 +2.4% 0.98x
StringEdits.o 12032 12216 +1.5% 0.98x
RomanNumbers.o 8149 8261 +1.4% 0.99x
 
Improvement OLD NEW DELTA RATIO
FindStringNaive.o 10491 10219 -2.6% 1.03x

Performance: -Onone

Regression OLD NEW DELTA RATIO
FindString.Loop1.Substring 1060 3022 +185.1% 0.35x
StringMatch 45600 88800 +94.7% 0.51x
CSVParsing.Char 935 1523 +62.9% 0.61x
FindString.Rec3.Substring 961 1541 +60.4% 0.62x
CSVParsing.UTF8 626 967 +54.5% 0.65x
CSVParsing.Scalar 654 986 +50.8% 0.66x
DropLastArrayLazy 31672 46263 +46.1% 0.68x
SuffixArrayLazy 32278 46992 +45.6% 0.69x
SuffixCountableRangeLazy 34330 49936 +45.5% 0.69x
DropFirstArrayLazy 96712 139946 +44.7% 0.69x
PrefixArrayLazy 98431 142392 +44.7% 0.69x
PrefixCountableRangeLazy 102860 148270 +44.1% 0.69x
CSVParsing.UTF16 603 868 +43.9% 0.69x
DropLastCountableRangeLazy 34537 48657 +40.9% 0.71x
DropFirstCountableRangeLazy 104581 147282 +40.8% 0.71x
FindString.Rec3.String 996 1355 +36.0% 0.74x
SuffixAnyCollectionLazy 56007 72401 +29.3% 0.77x
PrefixAnyCollectionLazy 172530 220823 +28.0% 0.78x
DropLastAnyCollectionLazy 55841 70787 +26.8% 0.79x
DropFirstAnyCollectionLazy 170086 214436 +26.1% 0.79x
ArrayAppendUTF16 25024 30124 +20.4% 0.83x
ArrayAppendLatin1 25160 30260 +20.3% 0.83x (?)
RomanNumbers2 10435 12017 +15.2% 0.87x (?)
StringBuilderWithLongSubstring 2450 2700 +10.2% 0.91x (?)
FlattenListFlatMap 263609 287832 +9.2% 0.92x (?)
ReversedBidirectional 83030 89663 +8.0% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
ArrayAppendLatin1Substring 54180 46944 -13.4% 1.15x (?)
ArrayAppendAsciiSubstring 53820 46728 -13.2% 1.15x (?)
ArrayAppendUTF16Substring 53712 46728 -13.0% 1.15x (?)
RandomDoubleLCG 54200 48804 -10.0% 1.11x (?)
DictionaryBridgeToObjC_Access 1163 1052 -9.5% 1.11x (?)
FloatingPointPrinting_Float_interpolated 60800 55600 -8.6% 1.09x (?)
DataSetCountSmall 211 194 -8.1% 1.09x (?)
ObjectiveCBridgeStringHash 77 71 -7.8% 1.08x (?)
ArrayOfPOD 1125 1042 -7.4% 1.08x (?)

Code size: -swiftlibs

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

@shahmishal
Copy link
Member

Please update the base branch to main by Oct 5th otherwise the pull request will be closed automatically.

  • How to change the base branch: (Link)
  • More detail about the branch update: (Link)

@lorentey
Copy link
Member Author

lorentey commented Oct 2, 2020

Closing.

@lorentey lorentey closed this Oct 2, 2020
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.

5 participants