Skip to content

Use @_borrowed on a few declarations in the stdlib and overlays #20415

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 2 commits into from
Nov 29, 2018

Conversation

rjmccall
Copy link
Contributor

@rjmccall rjmccall commented Nov 8, 2018

No description provided.

@rjmccall
Copy link
Contributor Author

rjmccall commented Nov 8, 2018

@swift-ci Please test.

@swift-ci
Copy link
Contributor

swift-ci commented Nov 8, 2018

Build failed
Swift Test Linux Platform
Git Sha - 7c566e6ef20ce2cea10ce9735efbb5efb6d1a441

@swift-ci
Copy link
Contributor

swift-ci commented Nov 8, 2018

Build failed
Swift Test OS X Platform
Git Sha - 7c566e6ef20ce2cea10ce9735efbb5efb6d1a441

@rjmccall
Copy link
Contributor Author

rjmccall commented Nov 8, 2018

@swift-ci Please test.

@swift-ci
Copy link
Contributor

swift-ci commented Nov 8, 2018

Build failed
Swift Test OS X Platform
Git Sha - 7c566e6ef20ce2cea10ce9735efbb5efb6d1a441

@swift-ci
Copy link
Contributor

swift-ci commented Nov 8, 2018

Build failed
Swift Test Linux Platform
Git Sha - 7c566e6ef20ce2cea10ce9735efbb5efb6d1a441

@rjmccall rjmccall force-pushed the stdlib-borrowed-storage branch 2 times, most recently from 640c737 to 8bdbac9 Compare November 8, 2018 07:32
@rjmccall
Copy link
Contributor Author

rjmccall commented Nov 8, 2018

@swift-ci Please test.

@swift-ci
Copy link
Contributor

swift-ci commented Nov 8, 2018

Build failed
Swift Test Linux Platform
Git Sha - 7c566e6ef20ce2cea10ce9735efbb5efb6d1a441

@swift-ci
Copy link
Contributor

swift-ci commented Nov 8, 2018

Build failed
Swift Test OS X Platform
Git Sha - 7c566e6ef20ce2cea10ce9735efbb5efb6d1a441

@rjmccall
Copy link
Contributor Author

rjmccall commented Nov 8, 2018

@swift-ci Please benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Nov 8, 2018

Build comment file:

Performance: -O

TEST OLD NEW DELTA RATIO
Regression
DropLastAnySeqCRangeIter 3270 7426 +127.1% 0.44x
DropLastAnySeqCRangeIterLazy 3277 7427 +126.6% 0.44x
SequenceAlgosAnySequence 12098 26942 +122.7% 0.45x
SuffixAnySeqCRangeIter 3561 7766 +118.1% 0.46x
SuffixAnySeqCRangeIterLazy 3562 7767 +118.1% 0.46x
SuffixSequenceLazy 3620 7772 +114.7% 0.47x
SuffixSequence 3626 7771 +114.3% 0.47x
DropLastAnySequenceLazy 4974 9776 +96.5% 0.51x
DropLastAnySequence 4890 9322 +90.6% 0.52x
SuffixAnySequence 5360 9074 +69.3% 0.59x
SuffixAnySequenceLazy 5437 9163 +68.5% 0.59x
IterateData 1395 1565 +12.2% 0.89x
Improvement
StringEdits 95516 86187 -9.8% 1.11x

Code size: -O

TEST OLD NEW DELTA RATIO
Regression
RandomShuffle.o 3408 3706 +8.7% 0.92x
StringMatch.o 4445 4541 +2.2% 0.98x
RemoveWhere.o 27351 27671 +1.2% 0.99x

Performance: -Osize

TEST OLD NEW DELTA RATIO
Regression
CharIteration_ascii_unicodeScalars 4525 20080 +343.8% 0.23x
CharIteration_tweet_unicodeScalars 8945 39679 +343.6% 0.23x
CharIteration_punctuated_unicodeScalars 1097 4758 +333.7% 0.23x
CharIteration_punctuated_unicodeScalars_Backwards 1228 4984 +305.9% 0.25x
CharIteration_ascii_unicodeScalars_Backwards 5268 21041 +299.4% 0.25x
CharIteration_tweet_unicodeScalars_Backwards 10464 41595 +297.5% 0.25x
CharIteration_korean_unicodeScalars 5978 21847 +265.5% 0.27x
CharIteration_chinese_unicodeScalars 4562 16535 +262.5% 0.28x
CharIteration_russian_unicodeScalars 5270 18701 +254.9% 0.28x
PrefixWhileSequence 470 1638 +248.5% 0.29x
CharIteration_japanese_unicodeScalars 7687 26488 +244.6% 0.29x
CharIteration_korean_unicodeScalars_Backwards 6661 22735 +241.3% 0.29x
CharIteration_chinese_unicodeScalars_Backwards 5044 17139 +239.8% 0.29x
CharIteration_punctuatedJapanese_unicodeScalars 1168 3911 +234.8% 0.30x
CharIteration_russian_unicodeScalars_Backwards 5847 19295 +230.0% 0.30x
CharIteration_japanese_unicodeScalars_Backwards 8632 27487 +218.4% 0.31x
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 1292 4059 +214.2% 0.32x
DropFirstAnySeqCRangeIter 21168 58876 +178.1% 0.36x
DropFirstAnySeqCRangeIterLazy 21183 58206 +174.8% 0.36x
CharIteration_utf16_unicodeScalars 6757 17901 +164.9% 0.38x
CharIndexing_tweet_unicodeScalars_Backwards 19453 51154 +163.0% 0.38x
SequenceAlgosAnySequence 12094 31689 +162.0% 0.38x
CharIndexing_ascii_unicodeScalars_Backwards 9870 25638 +159.8% 0.38x
PrefixAnySeqCntRangeLazy 15458 39890 +158.1% 0.39x
PrefixAnySeqCntRange 15468 39871 +157.8% 0.39x
SuffixAnySeqCntRangeLazy 5136 13201 +157.0% 0.39x
SuffixAnySeqCntRange 5140 13186 +156.5% 0.39x
DropLastAnySeqCntRangeLazy 5145 13195 +156.5% 0.39x
DropFirstAnySeqCntRange 15449 39619 +156.5% 0.39x
DropLastAnySeqCntRange 5148 13178 +156.0% 0.39x
DropFirstAnySeqCntRangeLazy 15460 39545 +155.8% 0.39x
CharIndexing_tweet_unicodeScalars 19795 50410 +154.7% 0.39x
CharIndexing_ascii_unicodeScalars 10047 25278 +151.6% 0.40x
PrefixAnySeqCRangeIter 16535 41146 +148.8% 0.40x
PrefixAnySeqCRangeIterLazy 16543 41141 +148.7% 0.40x
CharIndexing_punctuated_unicodeScalars_Backwards 2440 6023 +146.8% 0.41x
DropLastAnySeqCRangeIterLazy 3696 9013 +143.9% 0.41x
DropLastAnySeqCRangeIter 3699 9015 +143.7% 0.41x
CharIndexing_punctuated_unicodeScalars 2445 5898 +141.2% 0.41x
DropWhileAnySeqCRangeIter 17631 41901 +137.7% 0.42x
CharIndexing_russian_unicodeScalars_Backwards 9847 23324 +136.9% 0.42x
CharIndexing_japanese_unicodeScalars_Backwards 14164 33254 +134.8% 0.43x
CharIndexing_chinese_unicodeScalars_Backwards 8934 20837 +133.2% 0.43x
SuffixAnySeqCRangeIterLazy 3970 9255 +133.1% 0.43x
CharIndexing_japanese_unicodeScalars 13760 32018 +132.7% 0.43x
CharIndexing_korean_unicodeScalars_Backwards 12098 27981 +131.3% 0.43x
CharIndexing_chinese_unicodeScalars 8730 20118 +130.4% 0.43x
PrefixWhileAnySeqCRangeIter 9597 21956 +128.8% 0.44x
SuffixAnySeqCRangeIter 4047 9234 +128.2% 0.44x
CharIndexing_korean_unicodeScalars 11873 27074 +128.0% 0.44x
SuffixSequenceLazy 4005 9128 +127.9% 0.44x
SuffixSequence 4007 9127 +127.8% 0.44x
CharIteration_utf16_unicodeScalars_Backwards 8500 19347 +127.6% 0.44x
CharIndexing_russian_unicodeScalars 10003 22736 +127.3% 0.44x
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 2201 4845 +120.1% 0.45x
CharIndexing_punctuatedJapanese_unicodeScalars 2125 4665 +119.5% 0.46x
PrefixWhileAnySequence 11032 23358 +111.7% 0.47x
DropLastAnySequence 5591 11126 +99.0% 0.50x
SuffixAnySequenceLazy 5643 11170 +97.9% 0.51x
DropLastSequence 762 1498 +96.6% 0.51x
DropLastSequenceLazy 763 1499 +96.5% 0.51x
SuffixAnySequence 5556 10814 +94.6% 0.51x
CharIndexing_utf16_unicodeScalars 11356 21804 +92.0% 0.52x
DropLastAnySequenceLazy 5712 10957 +91.8% 0.52x
CharIndexing_utf16_unicodeScalars_Backwards 12415 22976 +85.1% 0.54x
IterateData 1354 1544 +14.0% 0.88x
Improvement
StringEdits 99847 87581 -12.3% 1.14x
RandomShuffleLCG2 1774 1654 -6.8% 1.07x

Code size: -Osize

TEST OLD NEW DELTA RATIO
Regression
AngryPhonebook.o 1144 1336 +16.8% 0.86x
RandomShuffle.o 3487 3799 +8.9% 0.92x
Chars.o 1613 1757 +8.9% 0.92x
CharacterProperties.o 21637 23197 +7.2% 0.93x
Combos.o 10245 10549 +3.0% 0.97x
NibbleSort.o 18596 19020 +2.3% 0.98x
StringEdits.o 13342 13646 +2.3% 0.98x
StringMatch.o 4873 4969 +2.0% 0.98x
Phonebook.o 12132 12324 +1.6% 0.98x
DictOfArraysToArrayOfDicts.o 31396 31860 +1.5% 0.99x
ObjectiveCBridgingStubs.o 17944 18152 +1.2% 0.99x
StringWalk.o 37400 37816 +1.1% 0.99x

Performance: -Onone

TEST OLD NEW DELTA RATIO
Regression
RangeAssignment 3457 23170 +570.2% 0.15x
PrefixArray 3440 15833 +360.3% 0.22x
SuffixArray 1156 5299 +358.4% 0.22x
DropFirstArray 3450 15691 +354.8% 0.22x
DropLastArray 1155 5187 +349.1% 0.22x
SequenceAlgosContiguousArray 285094 1272942 +346.5% 0.22x
DropLastCountableRangeLazy 12096 48790 +303.4% 0.25x
DropFirstCountableRangeLazy 36261 142703 +293.5% 0.25x
DropWhileArray 5741 22310 +288.6% 0.26x
PrefixCountableRangeLazy 36348 137395 +278.0% 0.26x
SortLettersInPlace 2303 8485 +268.4% 0.27x
PrefixArrayLazy 36444 127649 +250.3% 0.29x
SuffixCountableRangeLazy 12105 42053 +247.4% 0.29x
SortLargeExistentials 18707 64671 +245.7% 0.29x
DropLastArrayLazy 12251 41980 +242.7% 0.29x
PrefixWhileArray 10153 34514 +239.9% 0.29x
DropFirstArrayLazy 36838 123716 +235.8% 0.30x
RGBHistogram 29765 99659 +234.8% 0.30x
SuffixArrayLazy 12289 40141 +226.6% 0.31x
NibbleSort 217360 621988 +186.2% 0.35x
CaptureProp 285474 796843 +179.1% 0.36x
MapReduce 24277 66509 +174.0% 0.37x
MapReduceAnyCollection 24442 65073 +166.2% 0.38x
Phonebook 24560 64709 +163.5% 0.38x
WordCountHistogramASCII 53136 137886 +159.5% 0.39x
MapReduceClass2 2639 6794 +157.4% 0.39x
WordCountHistogramUTF16 55605 137857 +147.9% 0.40x
MapReduceNSDecimalNumber 2863 7029 +145.5% 0.41x
SumUsingReduceInto 144215 349623 +142.4% 0.41x
ReversedArray2 14172 34218 +141.4% 0.41x
CountAlgoArray 142607 343839 +141.1% 0.41x
SequenceAlgosArray 719590 1731800 +140.7% 0.42x
StringComparison_ascii 8606 20431 +137.4% 0.42x
SumUsingReduce 150028 356024 +137.3% 0.42x
ReversedDictionary2 15236 35901 +135.6% 0.42x
LazilyFilteredArrays2 63568 149167 +134.7% 0.43x
PrefixWhileCountableRange 14924 34870 +133.7% 0.43x
PrefixAnySeqCntRangeLazy 16288 37788 +132.0% 0.43x
SuffixAnySeqCntRange 5436 12561 +131.1% 0.43x
SuffixAnyCollection 5456 12579 +130.6% 0.43x
DropWhileArrayLazy 13118 30194 +130.2% 0.43x
SuffixAnySeqCntRangeLazy 5466 12573 +130.0% 0.43x
ArrayAppendLazyMap 161784 370300 +128.9% 0.44x
SuperChars 68316 155989 +128.3% 0.44x
UTF8Decode 28694 65479 +128.2% 0.44x
MapReduceLazyCollection 20986 47750 +127.5% 0.44x
FlattenListLoop 55592 125990 +126.6% 0.44x
SubstringComparable 1445 3272 +126.4% 0.44x
PrefixWhileAnySeqCntRange 30965 69592 +124.7% 0.44x
DropWhileAnyCollection 21128 47151 +123.2% 0.45x
DropWhileCountableRange 5265 11656 +121.4% 0.45x
LazilyFilteredArrayContains 727416 1588533 +118.4% 0.46x
PrefixWhileAnyCollection 30798 67177 +118.1% 0.46x
DropLastAnySeqCntRangeLazy 5437 11858 +118.1% 0.46x
DropLastAnySeqCntRange 5455 11871 +117.6% 0.46x
RandomShuffleLCG2 34320 74479 +117.0% 0.46x
StringComparison_fastPrenormal 6378 13673 +114.4% 0.47x
PrefixAnySeqCntRange 16286 34775 +113.5% 0.47x
DropWhileAnySeqCntRange 21230 45296 +113.4% 0.47x
PrefixWhileArrayLazy 11364 24243 +113.3% 0.47x
PrefixAnyCollection 16320 34810 +113.3% 0.47x
MapReduceAnyCollectionShort 36497 77761 +113.1% 0.47x
StringHashing_ascii 216 460 +113.0% 0.47x
RemoveWhereFilterInts 1895 4031 +112.7% 0.47x
StringComparison_latin1 4919 10443 +112.3% 0.47x
LazilyFilteredRange 563003 1193790 +112.0% 0.47x
SequenceAlgosRange 1314404 2784866 +111.9% 0.47x
DropLastAnyCollectionLazy 35010 73924 +111.2% 0.47x
SuffixAnyCollectionLazy 34934 73712 +111.0% 0.47x
DropLastAnyCollection 5450 11486 +110.8% 0.47x
DropWhileCountableRangeLazy 22929 48232 +110.4% 0.48x
DropFirstAnySeqCRangeIterLazy 22062 46351 +110.1% 0.48x
DropFirstAnySeqCntRangeLazy 16254 34072 +109.6% 0.48x
SequenceAlgosAnySequence 13392 28059 +109.5% 0.48x
DropFirstAnySeqCRangeIter 22070 46184 +109.3% 0.48x
DropFirstAnySeqCntRange 16275 34000 +108.9% 0.48x
PrefixWhileCountableRangeLazy 18798 39221 +108.6% 0.48x
SubstringEquatable 4601 9574 +108.1% 0.48x
MapReduceShort 36613 76025 +107.6% 0.48x
CharIndexing_utf16_unicodeScalars 280777 582652 +107.5% 0.48x
FilterEvenUsingReduceInto 1901 3936 +107.0% 0.48x
DropFirstAnyCollection 16440 34030 +107.0% 0.48x
ChainedFilterMap 232355 479445 +106.3% 0.48x
StringComparison_slowerPrenormal 3936 8102 +105.8% 0.49x
DropWhileAnyCollectionLazy 23284 47800 +105.3% 0.49x
MapReduceClassShort2 3892 7976 +104.9% 0.49x
PrefixAnySeqCRangeIter 17681 36047 +103.9% 0.49x
StringComparison_longSharedPrefix 2026 4119 +103.3% 0.49x
WordCountUniqueASCII 7310 14859 +103.3% 0.49x
SuffixAnySeqCRangeIterLazy 32689 66210 +102.5% 0.49x
PrefixAnySeqCRangeIterLazy 17736 35863 +102.2% 0.49x
SuffixAnySeqCRangeIter 32880 65892 +100.4% 0.50x
DropWhileAnySeqCntRangeLazy 23810 47596 +99.9% 0.50x
DropFirstAnyCollectionLazy 104695 208736 +99.4% 0.50x
Chars2 39396 78463 +99.2% 0.50x
StringComparison_emoji 1892 3758 +98.6% 0.50x
StringComparison_nonBMPSlowestPrenormal 3474 6875 +97.9% 0.51x
PrefixWhileAnySeqCRangeIter 34326 67814 +97.6% 0.51x
PrefixAnyCollectionLazy 106450 210140 +97.4% 0.51x
MapReduceNSDecimalNumberShort 4175 8239 +97.3% 0.51x
WordCountUniqueUTF16 8128 16028 +97.2% 0.51x
CharIndexing_chinese_unicodeScalars 248561 488698 +96.6% 0.51x
CharIndexing_korean_unicodeScalars 318928 625667 +96.2% 0.51x
DropWhileAnySeqCRangeIterLazy 24279 47626 +96.2% 0.51x
DropWhileAnySeqCRangeIter 24977 48804 +95.4% 0.51x
PrefixWhileAnyCollectionLazy 19088 37277 +95.3% 0.51x
PrefixWhileAnySeqCRangeIterLazy 19245 37520 +95.0% 0.51x
FatCompactMap 284035 553145 +94.7% 0.51x
RemoveWhereQuadraticString 2501 4870 +94.7% 0.51x
CharIndexing_tweet_unicodeScalars 644930 1250218 +93.9% 0.52x
StringBuilderSmallReservingCapacity 5143 9913 +92.7% 0.52x
StringBuilder 5129 9875 +92.5% 0.52x
StringUTF16Builder 5248 10040 +91.3% 0.52x
MapReduceString 1742 3299 +89.4% 0.53x
CharIndexing_punctuatedJapanese_unicodeScalars 57653 109100 +89.2% 0.53x
DropLastAnySeqCRangeIterLazy 39085 73474 +88.0% 0.53x
RomanNumbers 1460421 2735849 +87.3% 0.53x
CharIteration_ascii_unicodeScalars 235271 437562 +86.0% 0.54x
ArrayValueProp2 14742 27409 +85.9% 0.54x
CharIndexing_ascii_unicodeScalars 325320 604765 +85.9% 0.54x
StringUTF16SubstringBuilder 8579 15885 +85.2% 0.54x
DropLastAnySeqCRangeIter 39030 71939 +84.3% 0.54x
CSVParsingAltIndices2 6210 11383 +83.3% 0.55x
RemoveWhereFilterStrings 2591 4742 +83.0% 0.55x
CharIndexing_russian_unicodeScalars 272701 495272 +81.6% 0.55x
SubstringEqualString 1451 2627 +81.0% 0.55x
PrefixWhileAnySeqCntRangeLazy 20918 37809 +80.7% 0.55x
CharIteration_chinese_unicodeScalars_Backwards 188706 340915 +80.7% 0.55x
Dictionary 2141 3864 +80.5% 0.55x
RGBHistogramOfObjects 96563 173903 +80.1% 0.56x
ErrorHandling 5485 9842 +79.4% 0.56x
CharIndexing_punctuated_unicodeScalars 72838 130293 +78.9% 0.56x
MapReduceLazyCollectionShort 33636 60059 +78.6% 0.56x
RandomShuffleDef2 5870 10420 +77.5% 0.56x
CharIndexing_japanese_unicodeScalars 405632 719478 +77.4% 0.56x
CharIteration_russian_unicodeScalars_Backwards 207048 362055 +74.9% 0.57x
DataAppendSequence 2098704 3625740 +72.8% 0.58x
ArrayAppendRepeatCol 205525 354870 +72.7% 0.58x
MapReduceSequence 29020 49768 +71.5% 0.58x
RemoveWhereSwapInts 5078 8573 +68.8% 0.59x
RemoveWhereQuadraticInts 7851 13249 +68.8% 0.59x
CStringShortAscii 4581 7713 +68.4% 0.59x
CharIteration_russian_unicodeScalars 185617 306223 +65.0% 0.61x
DictionaryGroup 4546 7488 +64.7% 0.61x
RemoveWhereSwapStrings 5838 9564 +63.8% 0.61x
CharIteration_korean_unicodeScalars 231392 378255 +63.5% 0.61x
CharIteration_punctuated_unicodeScalars 49693 80558 +62.1% 0.62x
PrefixWhileSequence 25200 40731 +61.6% 0.62x
PrefixWhileAnySequence 25525 41142 +61.2% 0.62x
CharIteration_japanese_unicodeScalars 285472 459156 +60.8% 0.62x
AngryPhonebook 4400 7049 +60.2% 0.62x
CharIteration_tweet_unicodeScalars 463907 742681 +60.1% 0.62x
ObjectAllocation 1210 1936 +60.0% 0.63x
ObserverClosure 6050 9621 +59.0% 0.63x
CharIteration_korean_unicodeScalars_Backwards 242957 384953 +58.4% 0.63x
CharIteration_japanese_unicodeScalars_Backwards 299193 473879 +58.4% 0.63x
CharIteration_chinese_unicodeScalars 180123 285057 +58.3% 0.63x
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 43244 68403 +58.2% 0.63x
CharIteration_punctuated_unicodeScalars_Backwards 54738 86432 +57.9% 0.63x
CharIteration_tweet_unicodeScalars_Backwards 487397 767049 +57.4% 0.64x
CharIndexing_korean_unicodeScalars_Backwards 363374 565811 +55.7% 0.64x
RemoveWhereQuadraticStrings 9500 14740 +55.2% 0.64x
FilterEvenUsingReduce 3971 6148 +54.8% 0.65x
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 64503 99773 +54.7% 0.65x
CharIteration_punctuatedJapanese_unicodeScalars 43851 66844 +52.4% 0.66x
StaticArray 670 1021 +52.4% 0.66x
ObserverForwarderStruct 4098 6243 +52.3% 0.66x
CharIteration_ascii_unicodeScalars_Backwards 253540 385630 +52.1% 0.66x
CharIndexing_chinese_unicodeScalars_Backwards 290986 440393 +51.3% 0.66x
CharIndexing_punctuated_unicodeScalars_Backwards 81421 122540 +50.5% 0.66x
CharIteration_utf16_unicodeScalars 204514 304720 +49.0% 0.67x
MapReduceShortString 225 330 +46.7% 0.68x
ObserverPartiallyAppliedMethod 7427 10783 +45.2% 0.69x
Histogram 7144 10220 +43.1% 0.70x
StringEdits 154080 218621 +41.9% 0.70x
CharIteration_utf16_unicodeScalars_Backwards 214577 303768 +41.6% 0.71x
CharIndexing_tweet_unicodeScalars_Backwards 735742 1040901 +41.5% 0.71x
CharIndexing_ascii_unicodeScalars_Backwards 370601 523729 +41.3% 0.71x
StringHashing_latin1 776 1092 +40.7% 0.71x
DictionaryGroupOfObjects 7052 9918 +40.6% 0.71x
CharIndexing_russian_unicodeScalars_Backwards 310295 435706 +40.4% 0.71x
ObserverUnappliedMethod 7756 10821 +39.5% 0.72x
CharIndexing_japanese_unicodeScalars_Backwards 456326 632020 +38.5% 0.72x
DictionaryOfObjects 5503 7598 +38.1% 0.72x
DropLastSequence 27418 37834 +38.0% 0.72x
FlattenListFlatMap 259781 357850 +37.8% 0.73x
DropLastSequenceLazy 27510 37714 +37.1% 0.73x
DropLastAnySequence 27609 37532 +35.9% 0.74x
DropLastAnySequenceLazy 27599 37405 +35.5% 0.74x
DictOfArraysToArrayOfDicts 3912 5239 +33.9% 0.75x
CharIndexing_utf16_unicodeScalars_Backwards 309840 406574 +31.2% 0.76x
SuffixAnySequenceLazy 21192 27796 +31.2% 0.76x
QueueConcrete 13900 18185 +30.8% 0.76x
StrToInt 53135 67563 +27.2% 0.79x
StringRemoveDupes 947 1195 +26.2% 0.79x
SuffixAnySequence 21203 26650 +25.7% 0.80x
DictionaryOfAnyHashableStrings_insert 8042 10098 +25.6% 0.80x
SuffixSequence 21092 26395 +25.1% 0.80x
SuffixSequenceLazy 21163 26419 +24.8% 0.80x
QueueGeneric 19058 23646 +24.1% 0.81x
StringHashing_slowerPrenormal 1377 1706 +23.9% 0.81x
StrComplexWalk 46310 56579 +22.2% 0.82x
CountAlgoString 5829 7096 +21.7% 0.82x
PrimsSplit 7602 9210 +21.2% 0.83x
StringHashing_fastPrenormal 1983 2378 +19.9% 0.83x
PopFrontArrayGeneric 6178 7395 +19.7% 0.84x
Prims 7606 8978 +18.0% 0.85x
StringHashing_emoji 1538 1765 +14.8% 0.87x
StringWalk 45528 51529 +13.2% 0.88x
StringHashing_longSharedPrefix 1458 1628 +11.7% 0.90x
StringHashing_nonBMPSlowestPrenormal 2096 2340 +11.6% 0.90x
RemoveWhereFilterString 1255 1383 +10.2% 0.91x (?)
ArrayOfPOD 781 860 +10.1% 0.91x (?)
Improvement
CharacterPropertiesStashed 3844 3353 -12.8% 1.15x

Code size: -swiftlibs

TEST OLD NEW DELTA RATIO
Regression
libswiftSwiftOnoneSupport.dylib 163840 167936 +2.5% 0.98x
libswiftsimd.dylib 266240 270336 +1.5% 0.98x
libswiftStdlibUnittest.dylib 372736 376832 +1.1% 0.99x
libswiftCore.dylib 3211264 3244032 +1.0% 0.99x
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
--------------

Most of the stdlib's properties don't need @_borrowed because they're
@inlinable, but I did find one place in an overlay where it's probably
sensible to make the operation use generalized accessors even if
they're resilient.
This is a performance hack: inlining a coroutine can promote heap
allocations of the frame to stack allocations, which is valuable
out of proportion to the normal weight.  There are surely more
principled ways of getting this effect, though.
@rjmccall rjmccall force-pushed the stdlib-borrowed-storage branch from 8bdbac9 to d339eab Compare November 8, 2018 17:23
@rjmccall
Copy link
Contributor Author

rjmccall commented Nov 8, 2018

Previous full-test run succeeded. Smoke-testing the minor update.

@swift-ci Please smoke test.

@rjmccall
Copy link
Contributor Author

rjmccall commented Nov 8, 2018

@swift-ci Please benchmark.

@rjmccall
Copy link
Contributor Author

rjmccall commented Nov 8, 2018

@swift-ci Please smoke test.

@swift-ci
Copy link
Contributor

swift-ci commented Nov 8, 2018

Build comment file:

Performance: -O

TEST OLD NEW DELTA RATIO
Regression
SuffixSequence 3258 7459 +128.9% 0.44x
DropLastAnySeqCRangeIter 2932 6635 +126.3% 0.44x
DropLastAnySeqCRangeIterLazy 2937 6626 +125.6% 0.44x
SequenceAlgosAnySequence 10924 24174 +121.3% 0.45x
SuffixSequenceLazy 3373 7459 +121.1% 0.45x
SuffixAnySeqCRangeIterLazy 3203 6908 +115.7% 0.46x
SuffixAnySeqCRangeIter 3205 6907 +115.5% 0.46x
SuffixAnySequence 4388 8043 +83.3% 0.55x
DropLastAnySequenceLazy 4488 8162 +81.9% 0.55x
DropLastAnySequence 4498 8085 +79.7% 0.56x
SuffixAnySequenceLazy 4683 8130 +73.6% 0.58x
Improvement
StringEdits 87467 76887 -12.1% 1.14x
StringEqualPointerComparison 589 538 -8.7% 1.09x
NopDeinit 48722 44567 -8.5% 1.09x
Combos 541 495 -8.5% 1.09x
RemoveWhereFilterInts 42 39 -7.1% 1.08x

Code size: -O

TEST OLD NEW DELTA RATIO
Regression
RandomShuffle.o 3408 3706 +8.7% 0.92x
StringMatch.o 4445 4541 +2.2% 0.98x
RemoveWhere.o 27351 27671 +1.2% 0.99x

Performance: -Osize

TEST OLD NEW DELTA RATIO
Regression
PrefixWhileAnySeqCRangeIter 8615 20088 +133.2% 0.43x
SuffixAnySeqCntRangeLazy 4648 10565 +127.3% 0.44x
SuffixAnySeqCntRange 4649 10544 +126.8% 0.44x
PrefixAnySeqCntRangeLazy 13968 31413 +124.9% 0.44x
SequenceAlgosAnySequence 10791 24206 +124.3% 0.45x
PrefixAnySeqCntRange 13981 31058 +122.1% 0.45x
DropFirstAnySeqCntRangeLazy 13935 30803 +121.0% 0.45x
DropFirstAnySeqCntRange 13936 30771 +120.8% 0.45x
DropLastAnySeqCntRangeLazy 4656 10277 +120.7% 0.45x
DropLastAnySeqCntRange 4657 10275 +120.6% 0.45x
SuffixAnySeqCRangeIterLazy 3567 7846 +120.0% 0.45x
SuffixAnySeqCRangeIter 3567 7846 +120.0% 0.45x
DropFirstAnySeqCRangeIterLazy 19062 41674 +118.6% 0.46x
DropFirstAnySeqCRangeIter 19169 41872 +118.4% 0.46x
DropLastAnySeqCRangeIterLazy 3292 7024 +113.4% 0.47x
DropLastAnySeqCRangeIter 3292 7024 +113.4% 0.47x
PrefixAnySeqCRangeIterLazy 14903 31707 +112.8% 0.47x
PrefixAnySeqCRangeIter 14899 31673 +112.6% 0.47x
PrefixWhileAnySequence 9884 20949 +111.9% 0.47x
DropWhileAnySeqCRangeIter 15888 32527 +104.7% 0.49x
SuffixAnySequence 4975 8703 +74.9% 0.57x
DropLastAnySequence 5014 8740 +74.3% 0.57x
DropLastAnySequenceLazy 5079 8801 +73.3% 0.58x
SuffixSequence 4335 7285 +68.1% 0.60x
SuffixSequenceLazy 4334 7283 +68.0% 0.60x
SuffixAnySequenceLazy 5807 8797 +51.5% 0.66x
CharacterLiteralsLarge 89 100 +12.4% 0.89x
FlattenListLoop 3640 3980 +9.3% 0.91x (?)
Array2D 6202 6735 +8.6% 0.92x
Improvement
IterateData 1374 1214 -11.6% 1.13x
NopDeinit 51143 45798 -10.5% 1.12x
CharIteration_ascii_unicodeScalars_Backwards 4728 4255 -10.0% 1.11x
StringEqualPointerComparison 564 512 -9.2% 1.10x
CharIteration_russian_unicodeScalars_Backwards 5253 4787 -8.9% 1.10x
CharIteration_ascii_unicodeScalars 4061 3728 -8.2% 1.09x
CharIteration_tweet_unicodeScalars 8028 7374 -8.1% 1.09x
RandomShuffleLCG2 1592 1467 -7.9% 1.09x
CharIteration_tweet_unicodeScalars_Backwards 9391 8729 -7.0% 1.08x

Code size: -Osize

TEST OLD NEW DELTA RATIO
Regression
RandomShuffle.o 3487 3799 +8.9% 0.92x
CharacterProperties.o 21637 23197 +7.2% 0.93x
StringMatch.o 4873 4969 +2.0% 0.98x

Performance: -Onone

TEST OLD NEW DELTA RATIO
Regression
RangeAssignment 3089 21594 +599.1% 0.14x
PrefixArray 3099 19226 +520.4% 0.16x
DropLastArray 1039 4765 +358.6% 0.22x
SuffixArray 1040 4703 +352.2% 0.22x
DropFirstArray 3165 14267 +350.8% 0.22x
SequenceAlgosContiguousArray 255838 1146241 +348.0% 0.22x
DropWhileArray 5203 20365 +291.4% 0.26x
PrefixArrayLazy 34150 127290 +272.7% 0.27x
SortLettersInPlace 2040 7601 +272.6% 0.27x
SuffixCountableRangeLazy 10894 39534 +262.9% 0.28x
PrefixCountableRangeLazy 32814 118575 +261.4% 0.28x
DropFirstCountableRangeLazy 32588 115614 +254.8% 0.28x
SuffixArrayLazy 11357 40117 +253.2% 0.28x
DropLastCountableRangeLazy 10877 38389 +252.9% 0.28x
SortLargeExistentials 16557 56672 +242.3% 0.29x
PrefixWhileArray 9112 30926 +239.4% 0.29x
DropLastArrayLazy 11326 37160 +228.1% 0.30x
DropFirstArrayLazy 34020 110997 +226.3% 0.31x
RGBHistogram 28819 84000 +191.5% 0.34x
NibbleSort 193083 547201 +183.4% 0.35x
CountAlgoArray 127685 359883 +181.9% 0.35x
CaptureProp 255364 718249 +181.3% 0.36x
Phonebook 21380 58255 +172.5% 0.37x
FlattenListLoop 49438 133634 +170.3% 0.37x
MapReduce 22039 58526 +165.6% 0.38x
MapReduceAnyCollection 22051 58026 +163.1% 0.38x
FilterEvenUsingReduceInto 1683 4352 +158.6% 0.39x
MapReduceClass2 2386 6060 +154.0% 0.39x
ReversedArray2 12338 30486 +147.1% 0.40x
MapReduceNSDecimalNumber 2579 6247 +142.2% 0.41x
SumUsingReduceInto 128606 310610 +141.5% 0.41x
SequenceAlgosArray 643632 1554446 +141.5% 0.41x
StringComparison_ascii 7679 18363 +139.1% 0.42x
SumUsingReduce 134019 316655 +136.3% 0.42x
DropWhileArrayLazy 11709 27645 +136.1% 0.42x
ReversedDictionary2 13566 31789 +134.3% 0.43x
LazilyFilteredArrays2 56756 132223 +133.0% 0.43x
UTF8Decode 25755 59554 +131.2% 0.43x
WordCountHistogramUTF16 57905 133336 +130.3% 0.43x
DropWhileAnyCollection 19023 43473 +128.5% 0.44x
SubstringComparable 1292 2926 +126.5% 0.44x
PrefixAnySeqCntRangeLazy 14670 32991 +124.9% 0.44x
PrefixWhileAnySeqCntRange 27787 62165 +123.7% 0.45x
RandomShuffleLCG2 30415 67843 +123.1% 0.45x
PrefixWhileCountableRange 13388 29850 +123.0% 0.45x
PrefixAnySeqCntRange 14677 32703 +122.8% 0.45x
MapReduceClassShort2 3331 7333 +120.1% 0.45x
MapReduceAnyCollectionShort 31992 70164 +119.3% 0.46x
LazilyFilteredArrayContains 651611 1423320 +118.4% 0.46x
PrefixWhileAnyCollection 27785 60531 +117.9% 0.46x
WordCountHistogramASCII 56032 121615 +117.0% 0.46x
DropWhileCountableRange 4740 10274 +116.8% 0.46x
DropWhileAnySeqCntRange 19036 41188 +116.4% 0.46x
StringHashing_ascii 192 412 +114.6% 0.47x
DropLastAnySeqCntRangeLazy 4876 10435 +114.0% 0.47x
MapReduceShort 32322 69059 +113.7% 0.47x
SequenceAlgosRange 1181386 2521425 +113.4% 0.47x
DropLastAnyCollection 4875 10386 +113.0% 0.47x
DropFirstAnySeqCntRangeLazy 14582 31054 +113.0% 0.47x
PrefixAnyCollection 14752 31377 +112.7% 0.47x
DropLastAnySeqCntRange 4918 10429 +112.1% 0.47x
DropFirstAnySeqCRangeIterLazy 19838 42039 +111.9% 0.47x
SuperChars 60776 128685 +111.7% 0.47x
MapReduceNSDecimalNumberShort 3550 7499 +111.2% 0.47x
SuffixAnyCollection 4929 10396 +110.9% 0.47x
DropFirstAnyCollection 14725 31032 +110.7% 0.47x
DropFirstAnySeqCRangeIter 19879 41840 +110.5% 0.48x
SequenceAlgosAnySequence 12102 25452 +110.3% 0.48x
DropFirstAnySeqCntRange 14673 30845 +110.2% 0.48x
SuffixAnySeqCntRangeLazy 4917 10278 +109.0% 0.48x
RemoveWhereFilterInts 1689 3529 +108.9% 0.48x
PrefixWhileArrayLazy 10180 21257 +108.8% 0.48x
PrefixAnySeqCRangeIterLazy 15831 32942 +108.1% 0.48x
SuffixAnySeqCntRange 4897 10168 +107.6% 0.48x
SuffixAnyCollectionLazy 31324 65012 +107.5% 0.48x
PrefixAnySeqCRangeIter 15851 32713 +106.4% 0.48x
DropWhileCountableRangeLazy 20607 42508 +106.3% 0.48x
DropWhileAnyCollectionLazy 20873 43022 +106.1% 0.49x
DropWhileAnySeqCntRangeLazy 20966 43149 +105.8% 0.49x
LazilyFilteredRange 507696 1043712 +105.6% 0.49x
ArrayValueProp2 13155 27030 +105.5% 0.49x
DropWhileAnySeqCRangeIterLazy 20964 43019 +105.2% 0.49x
WordCountUniqueASCII 6630 13518 +103.9% 0.49x
DropLastAnyCollectionLazy 31550 63009 +99.7% 0.50x
StringComparison_longSharedPrefix 1809 3610 +99.6% 0.50x
DropWhileAnySeqCRangeIter 22363 44412 +98.6% 0.50x
WordCountUniqueUTF16 7135 14167 +98.6% 0.50x
StringComparison_latin1 4375 8678 +98.4% 0.50x
PrefixWhileAnyCollectionLazy 17102 33848 +97.9% 0.51x
PrefixWhileCountableRangeLazy 16746 33129 +97.8% 0.51x
PrefixWhileAnySeqCRangeIterLazy 17019 33608 +97.5% 0.51x
Chars2 35218 69333 +96.9% 0.51x
DropFirstAnyCollectionLazy 94448 185541 +96.4% 0.51x
CSVParsingAltIndices2 5440 10549 +93.9% 0.52x
StringBuilder 4670 8921 +91.0% 0.52x
PrefixAnyCollectionLazy 96879 184607 +90.6% 0.52x
CStringShortAscii 3616 6888 +90.5% 0.52x
FilterEvenUsingReduce 3306 6284 +90.1% 0.53x
MapReduceString 1560 2961 +89.8% 0.53x
StringComparison_slowerPrenormal 3525 6687 +89.7% 0.53x
StringComparison_fastPrenormal 5976 11320 +89.4% 0.53x
CharIndexing_punctuatedJapanese_unicodeScalars 55827 105574 +89.1% 0.53x
PrefixWhileAnySeqCRangeIter 30866 58234 +88.7% 0.53x
StringBuilderSmallReservingCapacity 4744 8947 +88.6% 0.53x
StringComparison_emoji 1693 3162 +86.8% 0.54x
SuffixAnySeqCRangeIterLazy 29384 54878 +86.8% 0.54x
CharIndexing_utf16_unicodeScalars 266818 498138 +86.7% 0.54x
StringComparison_nonBMPSlowestPrenormal 3117 5809 +86.4% 0.54x
SuffixAnySeqCRangeIter 29325 54639 +86.3% 0.54x
RomanNumbers 1313773 2444903 +86.1% 0.54x
RemoveWhereQuadraticString 2286 4250 +85.9% 0.54x
ChainedFilterMap 219622 406793 +85.2% 0.54x
StringUTF16Builder 4806 8884 +84.9% 0.54x
RemoveWhereFilterStrings 2321 4264 +83.7% 0.54x
DropLastAnySeqCRangeIterLazy 35203 64113 +82.1% 0.55x
DropLastAnySeqCRangeIter 35179 64030 +82.0% 0.55x
CharIteration_ascii_unicodeScalars_Backwards 219823 398557 +81.3% 0.55x
CharIteration_russian_unicodeScalars 162886 295308 +81.3% 0.55x
CharIndexing_japanese_unicodeScalars 386975 699019 +80.6% 0.55x
CharIteration_korean_unicodeScalars 205224 369209 +79.9% 0.56x
MapReduceLazyCollection 23779 42774 +79.9% 0.56x
ArrayAppendLazyMap 184736 331149 +79.3% 0.56x
Dictionary 1908 3416 +79.0% 0.56x
CharIteration_punctuated_unicodeScalars 43704 78245 +79.0% 0.56x
RGBHistogramOfObjects 88180 157714 +78.9% 0.56x
CharIndexing_ascii_unicodeScalars 315047 561303 +78.2% 0.56x
CharIndexing_tweet_unicodeScalars 624951 1113420 +78.2% 0.56x
CharIndexing_russian_unicodeScalars 264922 471635 +78.0% 0.56x
ErrorHandling 4942 8792 +77.9% 0.56x
CharIteration_tweet_unicodeScalars_Backwards 437089 777453 +77.9% 0.56x
CharIteration_ascii_unicodeScalars 206455 366135 +77.3% 0.56x
CharIndexing_punctuated_unicodeScalars 70222 124475 +77.3% 0.56x
PrefixWhileAnySeqCntRangeLazy 18855 33400 +77.1% 0.56x
CharIndexing_chinese_unicodeScalars 241168 424641 +76.1% 0.57x
CharIndexing_korean_unicodeScalars 310076 545644 +76.0% 0.57x
CharIteration_tweet_unicodeScalars 408783 719030 +75.9% 0.57x
CharIteration_chinese_unicodeScalars 158463 276998 +74.8% 0.57x
CharIteration_japanese_unicodeScalars 251209 438833 +74.7% 0.57x
CharIteration_punctuatedJapanese_unicodeScalars 37082 64622 +74.3% 0.57x
CharIteration_japanese_unicodeScalars_Backwards 267561 465794 +74.1% 0.57x
ArrayAppendRepeatCol 183376 318179 +73.5% 0.58x
DataAppendSequence 1890166 3264166 +72.7% 0.58x
SubstringEquatable 4665 8016 +71.8% 0.58x
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 38641 65847 +70.4% 0.59x
CharIteration_russian_unicodeScalars_Backwards 185423 314806 +69.8% 0.59x
CharIteration_punctuated_unicodeScalars_Backwards 48893 82617 +69.0% 0.59x
CharIteration_korean_unicodeScalars_Backwards 217950 368243 +69.0% 0.59x
CharIteration_chinese_unicodeScalars_Backwards 169307 285341 +68.5% 0.59x
RemoveWhereSwapInts 4557 7672 +68.4% 0.59x
RandomShuffleDef2 5243 8821 +68.2% 0.59x
MapReduceSequence 26141 43791 +67.5% 0.60x
DictionaryGroup 4055 6792 +67.5% 0.60x
SubstringEqualString 1291 2159 +67.2% 0.60x
RemoveWhereQuadraticInts 7061 11788 +66.9% 0.60x
MapReduceLazyCollectionShort 33680 55780 +65.6% 0.60x
RemoveWhereSwapStrings 5201 8604 +65.4% 0.60x
FatCompactMap 302148 495393 +64.0% 0.61x
AngryPhonebook 3953 6333 +60.2% 0.62x
StringUTF16SubstringBuilder 8348 13359 +60.0% 0.62x
CharIteration_utf16_unicodeScalars 180908 289172 +59.8% 0.63x
ObserverClosure 5333 8368 +56.9% 0.64x
ObserverForwarderStruct 3537 5503 +55.6% 0.64x
RemoveWhereQuadraticStrings 8514 13237 +55.5% 0.64x
ObjectAllocation 1078 1658 +53.8% 0.65x
StaticArray 595 911 +53.1% 0.65x
ObserverUnappliedMethod 6838 10293 +50.5% 0.66x
MapReduceShortString 201 301 +49.8% 0.67x
CharIteration_utf16_unicodeScalars_Backwards 194956 290805 +49.2% 0.67x
CharIndexing_korean_unicodeScalars_Backwards 330207 491998 +49.0% 0.67x
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 58414 86866 +48.7% 0.67x
CharIndexing_chinese_unicodeScalars_Backwards 256432 380225 +48.3% 0.67x
CountAlgoString 4497 6662 +48.1% 0.68x
CharIndexing_tweet_unicodeScalars_Backwards 667506 984716 +47.5% 0.68x
FlattenListFlatMap 233152 341973 +46.7% 0.68x
CharIndexing_ascii_unicodeScalars_Backwards 336470 492482 +46.4% 0.68x
CharIndexing_russian_unicodeScalars_Backwards 281999 412494 +46.3% 0.68x
ObserverPartiallyAppliedMethod 6528 9521 +45.8% 0.69x
DictionaryGroupOfObjects 6229 9027 +44.9% 0.69x
CharIndexing_punctuated_unicodeScalars_Backwards 74570 107701 +44.4% 0.69x
CharIndexing_japanese_unicodeScalars_Backwards 412400 593962 +44.0% 0.69x
DictionaryOfObjects 4911 6963 +41.8% 0.71x
StringHashing_latin1 685 965 +40.9% 0.71x
StringEdits 147255 204145 +38.6% 0.72x
DictOfArraysToArrayOfDicts 3491 4827 +38.3% 0.72x
CharIndexing_utf16_unicodeScalars_Backwards 281180 381841 +35.8% 0.74x
Histogram 6920 9384 +35.6% 0.74x
PrefixWhileSequence 24908 33584 +34.8% 0.74x
PrefixWhileAnySequence 25168 33864 +34.6% 0.74x
DropLastAnySequenceLazy 24541 32458 +32.3% 0.76x
DropLastSequence 24516 32350 +32.0% 0.76x
DropLastAnySequence 24557 32293 +31.5% 0.76x
DropLastSequenceLazy 24620 32269 +31.1% 0.76x
QueueConcrete 12559 16409 +30.7% 0.77x
RangeReplaceableCollectionPlusDefault 8296 10439 +25.8% 0.79x
QueueGeneric 17168 21155 +23.2% 0.81x
StringHashing_slowerPrenormal 1175 1443 +22.8% 0.81x
StrToInt 50002 60869 +21.7% 0.82x
PrimsSplit 6891 8257 +19.8% 0.83x
StringWalk 41728 49909 +19.6% 0.84x
SuffixAnySequenceLazy 19087 22767 +19.3% 0.84x
SuffixSequenceLazy 19046 22710 +19.2% 0.84x
StrComplexWalk 42014 50053 +19.1% 0.84x
Prims 6778 8058 +18.9% 0.84x
SuffixAnySequence 19175 22753 +18.7% 0.84x
SuffixSequence 19118 22645 +18.4% 0.84x
HashTest 10639 12452 +17.0% 0.85x
StringHashing_fastPrenormal 1752 2047 +16.8% 0.86x
PopFrontArrayGeneric 5649 6579 +16.5% 0.86x
StringHashing_nonBMPSlowestPrenormal 1775 2066 +16.4% 0.86x
StringHashing_longSharedPrefix 1289 1489 +15.5% 0.87x
StringHashing_emoji 1364 1566 +14.8% 0.87x
CSVParsingAlt2 3575 4034 +12.8% 0.89x
RemoveWhereFilterString 1125 1238 +10.0% 0.91x
DictionaryLiteral 7251 7814 +7.8% 0.93x

Code size: -swiftlibs

TEST OLD NEW DELTA RATIO
Regression
libswiftSwiftOnoneSupport.dylib 163840 167936 +2.5% 0.98x
libswiftsimd.dylib 266240 270336 +1.5% 0.98x
libswiftStdlibUnittest.dylib 372736 376832 +1.1% 0.99x
libswiftCore.dylib 3211264 3244032 +1.0% 0.99x
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: 8-Core Intel Xeon E5
  Processor Speed: 3 GHz
  Number of Processors: 1
  Total Number of Cores: 8
  L2 Cache (per Core): 256 KB
  L3 Cache: 25 MB
  Memory: 64 GB
--------------

@rjmccall
Copy link
Contributor Author

rjmccall commented Nov 8, 2018

@airspeedswift It looks like all the really serious non-Onone regressions here are in AnySequence benchmarks. Should I be worrying about those, or are they getting ripped out?

@rjmccall
Copy link
Contributor Author

rjmccall commented Nov 8, 2018

By the way, I think the perf hit here is that we're calling the read accessor and it's having to allocate space dynamically for its frame.

@rjmccall
Copy link
Contributor Author

rjmccall commented Nov 9, 2018

@airspeedswift By "ripped out", I mean "having the guts of the implementation so thoroughly replaced that I don't need to worry about a short-term regression".

@airspeedswift
Copy link
Member

Yeah, probably. Which isn't to say you'll still be causing regressions after this but impossible to say what. Let me rebase my PR on this one and see.

@airspeedswift
Copy link
Member

#20454

@airspeedswift
Copy link
Member

@swift-ci please benchmark

@airspeedswift
Copy link
Member

Re-benchmarking now I’ve merged #20221

@swift-ci
Copy link
Contributor

Build comment file:

Performance: -O

TEST OLD NEW DELTA RATIO
Regression
SequenceAlgosAnySequence 12364 27636 +123.5% 0.45x
SuffixAnySeqCntRangeLazy 20970 46737 +122.9% 0.45x
DropLastAnySeqCntRangeLazy 21200 47064 +122.0% 0.45x
SuffixAnySeqCRangeIterLazy 21063 46509 +120.8% 0.45x
DropLastAnySeqCRangeIterLazy 21084 45055 +113.7% 0.47x
IterateData 1399 1571 +12.3% 0.89x

Code size: -O

TEST OLD NEW DELTA RATIO
Regression
RandomShuffle.o 3381 3691 +9.2% 0.92x
StringMatch.o 4318 4430 +2.6% 0.97x
RemoveWhere.o 26391 26711 +1.2% 0.99x
NibbleSort.o 12168 12296 +1.1% 0.99x

Performance: -Osize

TEST OLD NEW DELTA RATIO
Regression
SuffixAnySeqCRangeIterLazy 21069 47452 +125.2% 0.44x
SuffixAnySeqCntRangeLazy 21007 46855 +123.0% 0.45x
SequenceAlgosAnySequence 12377 27119 +119.1% 0.46x
DropLastAnySeqCRangeIterLazy 20890 45218 +116.5% 0.46x
DropLastAnySeqCntRangeLazy 20892 45162 +116.2% 0.46x
DropFirstAnySeqCntRange 21407 45932 +114.6% 0.47x
PrefixAnySeqCntRange 16664 35547 +113.3% 0.47x
PrefixAnySeqCRangeIter 16664 34880 +109.3% 0.48x
DropFirstAnySeqCRangeIter 21358 44669 +109.1% 0.48x
IterateData 1364 1560 +14.4% 0.87x
Improvement
InsertCharacterEndIndex 159 146 -8.2% 1.09x

Code size: -Osize

TEST OLD NEW DELTA RATIO
Regression
RandomShuffle.o 3419 3767 +10.2% 0.91x
StringMatch.o 4281 4393 +2.6% 0.97x

Performance: -Onone

TEST OLD NEW DELTA RATIO
Regression
RangeAssignment 3399 23773 +599.4% 0.14x
DropFirstArrayLazy 22641 119838 +429.3% 0.19x
PrefixArrayLazy 22715 119510 +426.1% 0.19x
SuffixArrayLazy 7580 38906 +413.3% 0.19x
DropLastArrayLazy 7564 37659 +397.9% 0.20x
SequenceAlgosContiguousArray 295084 1460365 +394.9% 0.20x
PrefixWhileArray 7218 33863 +369.1% 0.21x
DropFirstCountableRangeLazy 29640 135795 +358.1% 0.22x
SuffixArray 1194 5354 +348.4% 0.22x
DropFirstArray 3561 15937 +347.5% 0.22x
DropLastArray 1221 5445 +345.9% 0.22x
PrefixArray 3563 15869 +345.4% 0.22x
SuffixCountableRangeLazy 9900 41800 +322.2% 0.24x
DropLastCountableRangeLazy 9880 41492 +320.0% 0.24x
PrefixCountableRangeLazy 29662 120696 +306.9% 0.25x
DropWhileArray 5365 21429 +299.4% 0.25x
ReversedArray2 9149 35055 +283.2% 0.26x
SortLettersInPlace 2238 8540 +281.6% 0.26x
RGBHistogram 26956 101812 +277.7% 0.26x
MapReduceAnyCollection 16528 58385 +253.2% 0.28x
SortLargeExistentials 18632 65681 +252.5% 0.28x
MapReduce 16570 57858 +249.2% 0.29x
ReversedDictionary2 10402 35410 +240.4% 0.29x
MapReduceClass2 1844 6088 +230.2% 0.30x
StringComparison_ascii 6125 20195 +229.7% 0.30x
LazilyFilteredArrays2 45572 148484 +225.8% 0.31x
CountAlgoArray 96546 306339 +217.3% 0.32x
SumUsingReduceInto 95018 297270 +212.9% 0.32x
MapReduceNSDecimalNumber 2054 6399 +211.5% 0.32x
SequenceAlgosArray 484196 1502489 +210.3% 0.32x
LazilyFilteredArrayContains 536732 1645174 +206.5% 0.33x
RandomShuffleLCG2 24176 71244 +194.7% 0.34x
CaptureProp 286653 844409 +194.6% 0.34x
StringHashing_ascii 159 456 +186.8% 0.35x
UTF8Decode 20109 57015 +183.5% 0.35x
DropWhileArrayLazy 9144 25856 +182.8% 0.35x
NibbleSort 216086 610041 +182.3% 0.35x
SumUsingReduce 109666 306677 +179.6% 0.36x
Phonebook 23492 64697 +175.4% 0.36x
SubstringComparable 1042 2852 +173.7% 0.37x
RemoveWhereFilterInts 1415 3864 +173.1% 0.37x
FlattenListLoop 41971 113623 +170.7% 0.37x
FilterEvenUsingReduceInto 1419 3824 +169.5% 0.37x
Chars2 31640 83205 +163.0% 0.38x
StringComparison_longSharedPrefix 1601 4162 +160.0% 0.38x
MapReduceLazyCollection 17562 45283 +157.8% 0.39x
MapReduceAnyCollectionShort 27882 71594 +156.8% 0.39x
PrefixWhileArrayLazy 8569 21981 +156.5% 0.39x
WordCountHistogramUTF16 54849 138983 +153.4% 0.39x
MapReduceClassShort2 2933 7333 +150.0% 0.40x
MapReduceShort 28628 71488 +149.7% 0.40x
WordCountHistogramASCII 52638 130627 +148.2% 0.40x
StringComparison_fastPrenormal 5264 13030 +147.5% 0.40x
MapReduceNSDecimalNumberShort 3141 7742 +146.5% 0.41x
StringComparison_latin1 4014 9879 +146.1% 0.41x
SuperChars 53524 130693 +144.2% 0.41x
StringComparison_slowerPrenormal 3256 7697 +136.4% 0.42x
CharIteration_chinese_unicodeScalars 90509 213215 +135.6% 0.42x
CharIteration_tweet_unicodeScalars 231276 539025 +133.1% 0.43x
CharIteration_ascii_unicodeScalars 116670 271792 +133.0% 0.43x
ArrayAppendLazyMap 124392 288972 +132.3% 0.43x
SubstringEquatable 3789 8750 +130.9% 0.43x
StringComparison_emoji 1576 3636 +130.7% 0.43x
RemoveWhereFilterStrings 2117 4868 +129.9% 0.43x
StringComparison_nonBMPSlowestPrenormal 2902 6669 +129.8% 0.44x
CharIteration_japanese_unicodeScalars 143686 329268 +129.2% 0.44x
CharIndexing_russian_unicodeScalars 237673 544503 +129.1% 0.44x
PrefixWhileCountableRange 15127 34484 +128.0% 0.44x
DropWhileCountableRangeLazy 23183 51652 +122.8% 0.45x
RemoveWhereQuadraticString 1982 4392 +121.6% 0.45x
ChainedFilterMap 187964 416095 +121.4% 0.45x
CharIndexing_utf16_unicodeScalars 257745 569874 +121.1% 0.45x
DropWhileAnyCollectionLazy 23657 52256 +120.9% 0.45x
DropWhileCountableRange 5355 11823 +120.8% 0.45x
PrefixWhileAnySeqCRangeIter 29490 64941 +120.2% 0.45x
FatCompactMap 239731 527509 +120.0% 0.45x
DropWhileAnyCollection 21509 47321 +120.0% 0.45x
CharIndexing_ascii_unicodeScalars 282087 620380 +119.9% 0.45x
CharIndexing_punctuated_unicodeScalars 63675 139525 +119.1% 0.46x
ArrayValueProp2 11609 25057 +115.8% 0.46x
CharIndexing_punctuatedJapanese_unicodeScalars 50361 108503 +115.5% 0.46x
StringBuilder 4129 8882 +115.1% 0.46x
CharIteration_korean_unicodeScalars 116834 251091 +114.9% 0.47x
RemoveWhereSwapInts 3696 7937 +114.7% 0.47x
CharIteration_russian_unicodeScalars 98860 211599 +114.0% 0.47x
StringBuilderSmallReservingCapacity 4133 8822 +113.5% 0.47x
SuffixAnySeqCntRange 29313 62540 +113.4% 0.47x
PrefixWhileAnySeqCntRange 29301 62436 +113.1% 0.47x
SequenceAlgosRange 1341889 2852927 +112.6% 0.47x
RandomShuffleDef2 4859 10301 +112.0% 0.47x
MapReduceString 1460 3093 +111.8% 0.47x
StringUTF16Builder 4258 9014 +111.7% 0.47x
CharIteration_punctuated_unicodeScalars 26637 56066 +110.5% 0.48x
DropLastAnyCollectionLazy 33719 70937 +110.4% 0.48x
CharIteration_punctuatedJapanese_unicodeScalars 21130 44322 +109.8% 0.48x
PrefixWhileAnySeqCRangeIterLazy 19408 40630 +109.3% 0.48x
PrefixAnySeqCntRangeLazy 16724 34987 +109.2% 0.48x
SuffixAnyCollection 5566 11641 +109.1% 0.48x
PrefixAnyCollection 16615 34701 +108.9% 0.48x
DropFirstAnySeqCRangeIter 22026 45978 +108.7% 0.48x
SequenceAlgosAnySequence 13820 28838 +108.7% 0.48x
CharIndexing_chinese_unicodeScalars 216045 450657 +108.6% 0.48x
PrefixAnySeqCRangeIterLazy 16815 35016 +108.2% 0.48x
CharIndexing_korean_unicodeScalars 277786 578079 +108.1% 0.48x
DropFirstAnySeqCntRange 22140 46028 +107.9% 0.48x
DropFirstAnyCollection 16633 34399 +106.8% 0.48x
DropLastAnyCollection 5585 11532 +106.5% 0.48x
RemoveWhereSwapStrings 4425 9107 +105.8% 0.49x
SuffixAnySeqCRangeIter 29139 59730 +105.0% 0.49x
PrefixAnyCollectionLazy 100203 204820 +104.4% 0.49x
PrefixAnySeqCntRange 17242 35236 +104.4% 0.49x
CharIndexing_japanese_unicodeScalars 342552 698763 +104.0% 0.49x
PrefixAnySeqCRangeIter 17201 35061 +103.8% 0.49x
PrefixWhileAnyCollectionLazy 19274 39276 +103.8% 0.49x
LazilyFilteredRange 582205 1183033 +103.2% 0.49x
PrefixWhileCountableRangeLazy 19035 38455 +102.0% 0.49x
RomanNumbers 1290419 2605517 +101.9% 0.50x
DropWhileAnySeqCRangeIterLazy 23607 47630 +101.8% 0.50x
DropWhileAnySeqCntRangeLazy 23694 47398 +100.0% 0.50x
SuffixAnyCollectionLazy 33394 66693 +99.7% 0.50x
SuffixAnySeqCRangeIterLazy 29736 59373 +99.7% 0.50x
MapReduceLazyCollectionShort 28444 56585 +98.9% 0.50x
CharIndexing_tweet_unicodeScalars 623108 1236718 +98.5% 0.50x
DropFirstAnyCollectionLazy 100988 200284 +98.3% 0.50x
CSVParsingAltIndices2 5700 11267 +97.7% 0.51x
DropLastAnySeqCRangeIter 34699 68255 +96.7% 0.51x
WordCountUniqueASCII 6126 12047 +96.7% 0.51x
PrefixWhileAnySeqCntRangeLazy 19294 37595 +94.9% 0.51x
SuffixAnySeqCntRangeLazy 29528 57485 +94.7% 0.51x
DropWhileAnySeqCRangeIter 25327 49295 +94.6% 0.51x
DropWhileAnySeqCntRange 25357 49066 +93.5% 0.52x
PrefixWhileAnyCollection 36355 69065 +90.0% 0.53x
WordCountUniqueUTF16 6711 12686 +89.0% 0.53x
ErrorHandling 4785 9022 +88.5% 0.53x
RGBHistogramOfObjects 89722 168973 +88.3% 0.53x
DataAppendSequence 2111922 3964815 +87.7% 0.53x
ArrayAppendRepeatCol 206142 386981 +87.7% 0.53x
DropFirstAnySeqCRangeIterLazy 25156 46337 +84.2% 0.54x
RemoveWhereQuadraticInts 6669 12276 +84.1% 0.54x
DropFirstAnySeqCntRangeLazy 25251 46339 +83.5% 0.54x
StringUTF16SubstringBuilder 13584 24725 +82.0% 0.55x
CharIteration_utf16_unicodeScalars 105005 190836 +81.7% 0.55x
DictionaryGroup 4432 8042 +81.5% 0.55x
MapReduceSequence 24972 45082 +80.5% 0.55x
FilterEvenUsingReduce 3320 5976 +80.0% 0.56x
Dictionary 1803 3245 +80.0% 0.56x
DropLastAnySeqCntRangeLazy 35211 63234 +79.6% 0.56x
SubstringEqualString 1294 2323 +79.5% 0.56x
CStringShortAscii 3924 7043 +79.5% 0.56x
DropLastAnySeqCntRange 35029 62797 +79.3% 0.56x
DropLastAnySeqCRangeIterLazy 35370 63286 +78.9% 0.56x
Histogram 4990 8853 +77.4% 0.56x
ObjectAllocation 1061 1822 +71.7% 0.58x
PrefixWhileAnySequence 20551 35011 +70.4% 0.59x
CharIteration_russian_unicodeScalars_Backwards 214342 363125 +69.4% 0.59x
RemoveWhereQuadraticStrings 8398 14172 +68.8% 0.59x
PrefixWhileSequence 20694 34886 +68.6% 0.59x
CharIndexing_japanese_unicodeScalars_Backwards 442818 739418 +67.0% 0.60x
ObserverForwarderStruct 3258 5433 +66.8% 0.60x
CharIteration_japanese_unicodeScalars_Backwards 313772 521308 +66.1% 0.60x
StaticArray 652 1077 +65.2% 0.61x
DictionaryGroupOfObjects 6007 9810 +63.3% 0.61x
MapReduceShortString 200 325 +62.5% 0.62x
FlattenListFlatMap 203432 324722 +59.6% 0.63x
CharIteration_tweet_unicodeScalars_Backwards 502768 797898 +58.7% 0.63x
StringHashing_latin1 701 1091 +55.6% 0.64x
AngryPhonebook 3935 6046 +53.6% 0.65x
ObserverClosure 5342 8200 +53.5% 0.65x
CharIteration_korean_unicodeScalars_Backwards 250262 383402 +53.2% 0.65x
CharIndexing_korean_unicodeScalars_Backwards 360589 549652 +52.4% 0.66x
CharIteration_punctuated_unicodeScalars_Backwards 56543 85807 +51.8% 0.66x
CharIteration_ascii_unicodeScalars_Backwards 255849 388245 +51.7% 0.66x
QueueConcrete 11209 16942 +51.1% 0.66x
CharIteration_chinese_unicodeScalars_Backwards 198245 298694 +50.7% 0.66x
CharIndexing_russian_unicodeScalars_Backwards 304719 457928 +50.3% 0.67x
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 45281 67626 +49.3% 0.67x
CharIndexing_punctuated_unicodeScalars_Backwards 80146 117557 +46.7% 0.68x
ObserverUnappliedMethod 7153 10435 +45.9% 0.69x
CharIndexing_tweet_unicodeScalars_Backwards 720573 1040964 +44.5% 0.69x
CharIteration_utf16_unicodeScalars_Backwards 222535 321186 +44.3% 0.69x
DictOfArraysToArrayOfDicts 3519 4977 +41.4% 0.71x
CharIndexing_chinese_unicodeScalars_Backwards 277484 392433 +41.4% 0.71x
CharIndexing_ascii_unicodeScalars_Backwards 366315 513975 +40.3% 0.71x
ObserverPartiallyAppliedMethod 6794 9532 +40.3% 0.71x
QueueGeneric 16288 22784 +39.9% 0.71x
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 63465 87978 +38.6% 0.72x
CharIndexing_utf16_unicodeScalars_Backwards 304111 421251 +38.5% 0.72x
StrToInt 51327 70448 +37.3% 0.73x
StringEdits 155962 209296 +34.2% 0.75x
DictionaryOfObjects 5278 6925 +31.2% 0.76x
StringHashing_slowerPrenormal 1248 1624 +30.1% 0.77x
RangeReplaceableCollectionPlusDefault 7930 10280 +29.6% 0.77x
Prims 5853 7480 +27.8% 0.78x
PrimsSplit 5919 7492 +26.6% 0.79x
StringHashing_fastPrenormal 1839 2309 +25.6% 0.80x
SuffixSequenceLazy 17676 21840 +23.6% 0.81x
SuffixAnySequence 17680 21746 +23.0% 0.81x
SuffixSequence 17621 21673 +23.0% 0.81x
DropLastSequence 23156 28316 +22.3% 0.82x
DropLastSequenceLazy 23213 28170 +21.4% 0.82x
SuffixAnySequenceLazy 18183 22057 +21.3% 0.82x
DropLastAnySequenceLazy 23623 28653 +21.3% 0.82x
StringHashing_longSharedPrefix 1361 1649 +21.2% 0.83x
DropLastAnySequence 23218 28130 +21.2% 0.83x
StringHashing_nonBMPSlowestPrenormal 1934 2314 +19.6% 0.84x
StringHashing_emoji 1491 1767 +18.5% 0.84x
CharacterPropertiesStashed 2894 3304 +14.2% 0.88x
CharacterPropertiesPrecomputed 3148 3571 +13.4% 0.88x
Improvement
SuffixCountableRange 140 120 -14.3% 1.17x

Code size: -swiftlibs

TEST OLD NEW DELTA RATIO
Regression
libswiftSwiftOnoneSupport.dylib 163840 167936 +2.5% 0.98x
libswiftCore.dylib 2998272 3035136 +1.2% 0.99x
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
--------------

@palimondo
Copy link
Contributor

@airspeedswift I think we can remove sequence benchmarks that have AnySequence in them, now that no stdlib API returns it after #20221. Should I go ahead with that?

@palimondo
Copy link
Contributor

Also, generally speaking, how much weight should we assign the performance regressions in Onone builds? The changes in commits looks trivial on the surface, but the slowdowns in unoptimized build look quite massive. Isn't it something that should not be overlooked?

@rjmccall
Copy link
Contributor Author

Okay, we agreed to do this.

@rjmccall
Copy link
Contributor Author

@swift-ci Please test.

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.

4 participants