Skip to content

[Runtime] Change protocol conformance scanning to use a concurrent array rather than a locked vector. #16254

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

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Apr 30, 2018

This is a different approach to #16219. We'll race them and see who wins.

rdar://problem/37173156

…ray rather than a locked vector.

rdar://problem/37173156
@mikeash
Copy link
Contributor Author

mikeash commented Apr 30, 2018

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (2)
TEST OLD NEW DELTA SPEEDUP
StringWordBuilder 2135 2304 +7.9% 0.93x (?)
MapReduceLazyCollectionShort 33 35 +6.1% 0.94x (?)
Improvement (8)
TEST OLD NEW DELTA SPEEDUP
FatCompactMap 233262 182869 -21.6% 1.28x
DropFirstSequence 2787 2405 -13.7% 1.16x (?)
PrefixWhileAnySequenceLazy 1423 1250 -12.2% 1.14x (?)
DropWhileAnySequenceLazy 1891 1665 -12.0% 1.14x (?)
DropLastAnySeqCntRangeLazy 12 11 -8.3% 1.09x
OpenClose 243 228 -6.2% 1.07x
StringFromLongWholeSubstring 19 18 -5.3% 1.06x
ObjectiveCBridgeStubURLAppendPath 258390 245034 -5.2% 1.05x (?)
No Changes (414)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 3353 3281 -2.1% 1.02x (?)
AnyHashableWithAClass 75623 78489 +3.8% 0.96x (?)
Array2D 2272 2272 +0.0% 1.00x
ArrayAppend 941 944 +0.3% 1.00x (?)
ArrayAppendArrayOfInt 671 670 -0.1% 1.00x (?)
ArrayAppendAscii 12551 12619 +0.5% 0.99x
ArrayAppendFromGeneric 672 672 +0.0% 1.00x
ArrayAppendGenericStructs 1210 1210 +0.0% 1.00x
ArrayAppendLatin1 36387 36487 +0.3% 1.00x (?)
ArrayAppendLazyMap 1176 1177 +0.1% 1.00x (?)
ArrayAppendOptionals 1208 1209 +0.1% 1.00x (?)
ArrayAppendRepeatCol 1175 1178 +0.3% 1.00x (?)
ArrayAppendReserved 714 713 -0.1% 1.00x (?)
ArrayAppendSequence 978 978 +0.0% 1.00x
ArrayAppendStrings 5562 5656 +1.7% 0.98x (?)
ArrayAppendToFromGeneric 672 672 +0.0% 1.00x
ArrayAppendToGeneric 672 671 -0.1% 1.00x (?)
ArrayAppendUTF16 35874 36120 +0.7% 0.99x (?)
ArrayInClass 77 77 +0.0% 1.00x
ArrayLiteral 0 0 +0.0% 1.00x
ArrayOfGenericPOD2 129 129 +0.0% 1.00x
ArrayOfGenericRef 3912 3938 +0.7% 0.99x (?)
ArrayOfPOD 155 155 +0.0% 1.00x
ArrayOfRef 3891 3887 -0.1% 1.00x (?)
ArrayPlusEqualArrayOfInt 671 670 -0.1% 1.00x (?)
ArrayPlusEqualFiveElementCollection 4753 4752 -0.0% 1.00x (?)
ArrayPlusEqualSingleElementCollection 945 945 +0.0% 1.00x
ArrayPlusEqualThreeElements 1484 1478 -0.4% 1.00x (?)
ArraySubscript 1475 1474 -0.1% 1.00x (?)
ArrayValueProp 7 7 +0.0% 1.00x
ArrayValueProp2 7 7 +0.0% 1.00x
ArrayValueProp3 7 7 +0.0% 1.00x
ArrayValueProp4 7 7 +0.0% 1.00x
BinaryFloatingPointPropertiesBinade 23 23 +0.0% 1.00x
BinaryFloatingPointPropertiesNextUp 25 25 +0.0% 1.00x
BinaryFloatingPointPropertiesUlp 31 31 +0.0% 1.00x
BitCount 181 181 +0.0% 1.00x
ByteSwap 91 91 +0.0% 1.00x
COWTree 4788 4826 +0.8% 0.99x (?)
CSVParsing 640609 639042 -0.2% 1.00x (?)
CSVParsingAlt 703403 699542 -0.5% 1.01x (?)
CSVParsingAltIndices 312143 313058 +0.3% 1.00x (?)
CStringLongAscii 4153 4166 +0.3% 1.00x (?)
CStringLongNonAscii 1999 1947 -2.6% 1.03x
CStringShortAscii 2834 2835 +0.0% 1.00x (?)
Calculator 1020 1026 +0.6% 0.99x
CaptureProp 3689 3674 -0.4% 1.00x (?)
ChainedFilterMap 1263 1262 -0.1% 1.00x (?)
CharIndexing_ascii_unicodeScalars 15571 15589 +0.1% 1.00x (?)
CharIndexing_ascii_unicodeScalars_Backwards 14685 14697 +0.1% 1.00x (?)
CharIndexing_chinese_unicodeScalars 11787 11806 +0.2% 1.00x (?)
CharIndexing_chinese_unicodeScalars_Backwards 11123 11136 +0.1% 1.00x (?)
CharIndexing_japanese_unicodeScalars 18649 18665 +0.1% 1.00x (?)
CharIndexing_japanese_unicodeScalars_Backwards 17582 17585 +0.0% 1.00x (?)
CharIndexing_korean_unicodeScalars 15098 15124 +0.2% 1.00x (?)
CharIndexing_korean_unicodeScalars_Backwards 14240 14247 +0.0% 1.00x (?)
CharIndexing_punctuatedJapanese_unicodeScalars 2812 2829 +0.6% 0.99x
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 2676 2687 +0.4% 1.00x
CharIndexing_punctuated_unicodeScalars 3520 3541 +0.6% 0.99x (?)
CharIndexing_punctuated_unicodeScalars_Backwards 3341 3352 +0.3% 1.00x (?)
CharIndexing_russian_unicodeScalars 12972 12991 +0.1% 1.00x (?)
CharIndexing_russian_unicodeScalars_Backwards 12236 12246 +0.1% 1.00x (?)
CharIndexing_tweet_unicodeScalars 30357 30427 +0.2% 1.00x (?)
CharIndexing_tweet_unicodeScalars_Backwards 28944 28862 -0.3% 1.00x (?)
CharIndexing_utf16_unicodeScalars 20689 20658 -0.1% 1.00x (?)
CharIndexing_utf16_unicodeScalars_Backwards 20976 20880 -0.5% 1.00x (?)
CharIteration_ascii_unicodeScalars 19630 19568 -0.3% 1.00x (?)
CharIteration_ascii_unicodeScalars_Backwards 13550 13567 +0.1% 1.00x (?)
CharIteration_chinese_unicodeScalars 14836 14808 -0.2% 1.00x (?)
CharIteration_chinese_unicodeScalars_Backwards 10260 10278 +0.2% 1.00x
CharIteration_japanese_unicodeScalars 23535 23434 -0.4% 1.00x (?)
CharIteration_japanese_unicodeScalars_Backwards 16219 16239 +0.1% 1.00x (?)
CharIteration_korean_unicodeScalars 19023 18970 -0.3% 1.00x (?)
CharIteration_korean_unicodeScalars_Backwards 13137 13156 +0.1% 1.00x (?)
CharIteration_punctuatedJapanese_unicodeScalars 3500 3496 -0.1% 1.00x (?)
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 2452 2471 +0.8% 0.99x
CharIteration_punctuated_unicodeScalars 4395 4388 -0.2% 1.00x (?)
CharIteration_punctuated_unicodeScalars_Backwards 3069 3087 +0.6% 0.99x
CharIteration_russian_unicodeScalars 16350 16297 -0.3% 1.00x (?)
CharIteration_russian_unicodeScalars_Backwards 11289 11307 +0.2% 1.00x (?)
CharIteration_tweet_unicodeScalars 38542 38706 +0.4% 1.00x
CharIteration_tweet_unicodeScalars_Backwards 26766 26781 +0.1% 1.00x (?)
CharIteration_utf16_unicodeScalars 25337 25282 -0.2% 1.00x (?)
CharIteration_utf16_unicodeScalars_Backwards 16717 16610 -0.6% 1.01x (?)
CharacterLiteralsLarge 5200 5207 +0.1% 1.00x (?)
CharacterLiteralsSmall 195 195 +0.0% 1.00x
CharacterPropertiesFetch 4050 4085 +0.9% 0.99x (?)
CharacterPropertiesPrecomputed 1106 1123 +1.5% 0.98x
CharacterPropertiesStashed 1298 1309 +0.8% 0.99x (?)
CharacterPropertiesStashedMemo 1490 1511 +1.4% 0.99x (?)
Chars 1090 1090 +0.0% 1.00x
ClassArrayGetter 13 13 +0.0% 1.00x
Combos 437 438 +0.2% 1.00x (?)
DataAccessBytes 1110 1110 +0.0% 1.00x
DataAppendArray 5729 5550 -3.1% 1.03x (?)
DataAppendBytes 5389 5324 -1.2% 1.01x (?)
DataAppendDataLargeToLarge 61022 61276 +0.4% 1.00x (?)
DataAppendDataLargeToMedium 32539 32569 +0.1% 1.00x (?)
DataAppendDataLargeToSmall 31678 31618 -0.2% 1.00x (?)
DataAppendDataMediumToLarge 34533 34696 +0.5% 1.00x (?)
DataAppendDataMediumToMedium 6903 6999 +1.4% 0.99x (?)
DataAppendDataMediumToSmall 6269 6238 -0.5% 1.00x (?)
DataAppendDataSmallToLarge 33718 33674 -0.1% 1.00x (?)
DataAppendDataSmallToMedium 6571 6577 +0.1% 1.00x (?)
DataAppendDataSmallToSmall 6269 6123 -2.3% 1.02x (?)
DataAppendSequence 17630 17592 -0.2% 1.00x (?)
DataCopyBytes 2254 2263 +0.4% 1.00x (?)
DataCount 33 33 +0.0% 1.00x
DataMutateBytes 3909 3832 -2.0% 1.02x (?)
DataReplaceLarge 37304 36715 -1.6% 1.02x (?)
DataReplaceLargeBuffer 51897 52065 +0.3% 1.00x (?)
DataReplaceMedium 10232 10092 -1.4% 1.01x (?)
DataReplaceMediumBuffer 10910 11202 +2.7% 0.97x (?)
DataReplaceSmall 8083 8001 -1.0% 1.01x (?)
DataReplaceSmallBuffer 8251 8475 +2.7% 0.97x (?)
DataReset 2846 2846 +0.0% 1.00x
DataSetCount 809 818 +1.1% 0.99x
DataSubscript 221 217 -1.8% 1.02x
DictOfArraysToArrayOfDicts 735 743 +1.1% 0.99x (?)
Dictionary 657 643 -2.1% 1.02x
Dictionary2 770 753 -2.2% 1.02x (?)
Dictionary2OfObjects 1991 1990 -0.1% 1.00x (?)
Dictionary3 273 268 -1.8% 1.02x (?)
Dictionary3OfObjects 689 685 -0.6% 1.01x (?)
Dictionary4 302 294 -2.6% 1.03x
Dictionary4Legacy 705 704 -0.1% 1.00x (?)
Dictionary4OfObjects 406 401 -1.2% 1.01x
Dictionary4OfObjectsLegacy 892 894 +0.2% 1.00x (?)
DictionaryBridge 1072 1063 -0.8% 1.01x (?)
DictionaryCopy 108267 108455 +0.2% 1.00x (?)
DictionaryFilter 107133 107243 +0.1% 1.00x (?)
DictionaryGroup 251 251 +0.0% 1.00x
DictionaryGroupOfObjects 1912 1920 +0.4% 1.00x (?)
DictionaryLiteral 1880 1883 +0.2% 1.00x (?)
DictionaryOfObjects 2229 2226 -0.1% 1.00x (?)
DictionaryRemove 4998 5073 +1.5% 0.99x (?)
DictionaryRemoveOfObjects 23986 23985 -0.0% 1.00x (?)
DictionarySubscriptDefaultMutation 308 304 -1.3% 1.01x
DictionarySubscriptDefaultMutationArray 617 621 +0.6% 0.99x (?)
DictionarySubscriptDefaultMutationArrayOfObjects 3591 3588 -0.1% 1.00x (?)
DictionarySubscriptDefaultMutationOfObjects 1547 1547 +0.0% 1.00x
DictionarySwap 1341 1336 -0.4% 1.00x (?)
DictionarySwapAt 6507 6530 +0.4% 1.00x (?)
DictionarySwapAtOfObjects 47197 47181 -0.0% 1.00x (?)
DictionarySwapOfObjects 7722 7807 +1.1% 0.99x (?)
DoubleWidthDivision 0 0 +0.0% 1.00x
DropFirstAnyCollection 75 75 +0.0% 1.00x
DropFirstAnyCollectionLazy 55863 55351 -0.9% 1.01x (?)
DropFirstAnySeqCRangeIter 19110 19347 +1.2% 0.99x
DropFirstAnySeqCRangeIterLazy 19159 19422 +1.4% 0.99x
DropFirstAnySeqCntRange 37 36 -2.7% 1.03x
DropFirstAnySeqCntRangeLazy 37 36 -2.7% 1.03x
DropFirstAnySequence 4685 4683 -0.0% 1.00x (?)
DropFirstAnySequenceLazy 4676 4677 +0.0% 1.00x (?)
DropFirstArray 31 31 +0.0% 1.00x
DropFirstArrayLazy 31 31 +0.0% 1.00x
DropFirstCountableRange 31 31 +0.0% 1.00x
DropFirstCountableRangeLazy 31 31 +0.0% 1.00x
DropFirstSequenceLazy 2809 2810 +0.0% 1.00x (?)
DropLastAnyCollection 28 27 -3.6% 1.04x
DropLastAnyCollectionLazy 18557 18470 -0.5% 1.00x (?)
DropLastAnySeqCRangeIter 3264 3255 -0.3% 1.00x (?)
DropLastAnySeqCRangeIterLazy 3264 3257 -0.2% 1.00x (?)
DropLastAnySeqCntRange 11 11 +0.0% 1.00x
DropLastAnySequence 4574 4560 -0.3% 1.00x (?)
DropLastAnySequenceLazy 4672 4662 -0.2% 1.00x (?)
DropLastCountableRange 10 10 +0.0% 1.00x
DropLastCountableRangeLazy 10 10 +0.0% 1.00x
DropLastSequence 482 482 +0.0% 1.00x
DropLastSequenceLazy 483 483 +0.0% 1.00x
DropWhileAnyCollection 96 96 +0.0% 1.00x
DropWhileAnyCollectionLazy 112 112 +0.0% 1.00x
DropWhileAnySeqCRangeIter 15062 15146 +0.6% 0.99x (?)
DropWhileAnySeqCRangeIterLazy 112 112 +0.0% 1.00x
DropWhileAnySeqCntRange 45 45 +0.0% 1.00x
DropWhileAnySeqCntRangeLazy 112 112 +0.0% 1.00x
DropWhileAnySequence 4416 4419 +0.1% 1.00x (?)
DropWhileArrayLazy 79 79 +0.0% 1.00x
DropWhileCountableRange 32 32 +0.0% 1.00x
DropWhileCountableRangeLazy 94 94 +0.0% 1.00x
DropWhileSequence 1993 1993 +0.0% 1.00x
DropWhileSequenceLazy 79 79 +0.0% 1.00x
EqualStringSubstring 50 50 +0.0% 1.00x
EqualSubstringString 58 57 -1.7% 1.02x
EqualSubstringSubstring 44 43 -2.3% 1.02x
EqualSubstringSubstringGenericEquatable 44 43 -2.3% 1.02x
ErrorHandling 1357 1362 +0.4% 1.00x (?)
ExclusivityGlobal 5 5 +0.0% 1.00x
ExclusivityIndependent 2 2 +0.0% 1.00x
FilterEvenUsingReduce 1167 1170 +0.3% 1.00x (?)
FilterEvenUsingReduceInto 131 131 +0.0% 1.00x
FloatingPointPrinting_Double_description_small 21198 21189 -0.0% 1.00x (?)
FloatingPointPrinting_Double_description_uniform 20866 20803 -0.3% 1.00x (?)
FloatingPointPrinting_Double_interpolated 69949 70674 +1.0% 0.99x (?)
FloatingPointPrinting_Float80_description_small 27438 27551 +0.4% 1.00x (?)
FloatingPointPrinting_Float80_description_uniform 26698 26703 +0.0% 1.00x (?)
FloatingPointPrinting_Float80_interpolated 73355 72687 -0.9% 1.01x (?)
FloatingPointPrinting_Float_description_small 4716 4714 -0.0% 1.00x (?)
FloatingPointPrinting_Float_description_uniform 4680 4673 -0.1% 1.00x (?)
FloatingPointPrinting_Float_interpolated 47220 47385 +0.3% 1.00x (?)
FrequenciesUsingReduce 4417 4594 +4.0% 0.96x (?)
FrequenciesUsingReduceInto 1386 1394 +0.6% 0.99x (?)
Hanoi 2023 1999 -1.2% 1.01x (?)
HashTest 924 922 -0.2% 1.00x (?)
Histogram 813 809 -0.5% 1.00x (?)
Integrate 306 301 -1.6% 1.02x
IterateData 1750 1757 +0.4% 1.00x (?)
Join 169 165 -2.4% 1.02x
LazilyFilteredArrayContains 32894 31819 -3.3% 1.03x
LazilyFilteredArrays 59051 58830 -0.4% 1.00x (?)
LazilyFilteredRange 3468 3470 +0.1% 1.00x (?)
LessSubstringSubstring 45 43 -4.4% 1.05x
LessSubstringSubstringGenericComparable 45 43 -4.4% 1.05x
LinkedList 6747 6747 +0.0% 1.00x
LuhnAlgoEager 271 269 -0.7% 1.01x (?)
LuhnAlgoLazy 269 270 +0.4% 1.00x (?)
MapReduce 358 358 +0.0% 1.00x
MapReduceAnyCollection 360 361 +0.3% 1.00x (?)
MapReduceAnyCollectionShort 2010 2000 -0.5% 1.00x (?)
MapReduceClass 2692 2691 -0.0% 1.00x (?)
MapReduceClassShort 4077 4081 +0.1% 1.00x (?)
MapReduceLazyCollection 12 12 +0.0% 1.00x
MapReduceLazySequence 77 77 +0.0% 1.00x
MapReduceSequence 406 403 -0.7% 1.01x (?)
MapReduceShort 1784 1778 -0.3% 1.00x (?)
MapReduceShortString 27 27 +0.0% 1.00x
MapReduceString 70 71 +1.4% 0.99x (?)
Memset 192 192 +0.0% 1.00x
MonteCarloE 9118 9121 +0.0% 1.00x (?)
MonteCarloPi 38276 38291 +0.0% 1.00x (?)
NSDictionaryCastToSwift 4952 4973 +0.4% 1.00x (?)
NSError 155 155 +0.0% 1.00x
NSStringConversion 661 639 -3.3% 1.03x
NibbleSort 3293 3292 -0.0% 1.00x (?)
NopDeinit 28877 29019 +0.5% 1.00x (?)
ObjectAllocation 118 118 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObject 22853 22631 -1.0% 1.01x (?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 4224 4242 +0.4% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 40222 41558 +3.3% 0.97x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 38966 38866 -0.3% 1.00x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 102753 104250 +1.5% 0.99x (?)
ObjectiveCBridgeFromNSSetAnyObject 44654 43382 -2.8% 1.03x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 4238 4259 +0.5% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 57129 57306 +0.3% 1.00x (?)
ObjectiveCBridgeFromNSString 1078 1072 -0.6% 1.01x (?)
ObjectiveCBridgeFromNSStringForced 2408 2394 -0.6% 1.01x (?)
ObjectiveCBridgeStubDataAppend 10128 10075 -0.5% 1.01x (?)
ObjectiveCBridgeStubDateMutation 359 359 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 29263 29147 -0.4% 1.00x (?)
ObjectiveCBridgeStubFromNSDate 5870 5864 -0.1% 1.00x (?)
ObjectiveCBridgeStubFromNSString 929 908 -2.3% 1.02x (?)
ObjectiveCBridgeStubFromNSStringRef 145 144 -0.7% 1.01x (?)
ObjectiveCBridgeStubNSDataAppend 2267 2249 -0.8% 1.01x (?)
ObjectiveCBridgeStubNSDateMutationRef 11810 11953 +1.2% 0.99x (?)
ObjectiveCBridgeStubToArrayOfNSString 34187 33883 -0.9% 1.01x (?)
ObjectiveCBridgeStubToNSDate 13048 13406 +2.7% 0.97x (?)
ObjectiveCBridgeStubToNSDateRef 3002 3016 +0.5% 1.00x (?)
ObjectiveCBridgeStubToNSString 2132 2131 -0.0% 1.00x (?)
ObjectiveCBridgeStubToNSStringRef 101 101 +0.0% 1.00x
ObjectiveCBridgeStubURLAppendPathRef 253935 256883 +1.2% 0.99x (?)
ObjectiveCBridgeToNSArray 12692 12528 -1.3% 1.01x (?)
ObjectiveCBridgeToNSDictionary 21796 22001 +0.9% 0.99x (?)
ObjectiveCBridgeToNSSet 14413 14138 -1.9% 1.02x (?)
ObjectiveCBridgeToNSString 446 444 -0.4% 1.00x (?)
ObserverClosure 1912 1916 +0.2% 1.00x (?)
ObserverForwarderStruct 1061 1061 +0.0% 1.00x
ObserverPartiallyAppliedMethod 3332 3314 -0.5% 1.01x (?)
ObserverUnappliedMethod 2303 2280 -1.0% 1.01x (?)
PartialApplyDynamicType 0 0 +0.0% 1.00x
Phonebook 4692 4515 -3.8% 1.04x
PointerArithmetics 28249 28245 -0.0% 1.00x (?)
PolymorphicCalls 22 22 +0.0% 1.00x
PopFrontArray 1672 1672 +0.0% 1.00x
PopFrontArrayGeneric 1681 1681 +0.0% 1.00x
PopFrontUnsafePointer 8052 8054 +0.0% 1.00x (?)
PrefixAnyCollection 75 74 -1.3% 1.01x (?)
PrefixAnyCollectionLazy 55889 55395 -0.9% 1.01x (?)
PrefixAnySeqCRangeIter 14812 15061 +1.7% 0.98x (?)
PrefixAnySeqCRangeIterLazy 14823 15065 +1.6% 0.98x
PrefixAnySeqCntRange 25 25 +0.0% 1.00x
PrefixAnySeqCntRangeLazy 25 25 +0.0% 1.00x
PrefixAnySequence 3894 3889 -0.1% 1.00x (?)
PrefixAnySequenceLazy 3890 3888 -0.1% 1.00x (?)
PrefixArray 31 31 +0.0% 1.00x
PrefixArrayLazy 31 31 +0.0% 1.00x
PrefixCountableRange 31 31 +0.0% 1.00x
PrefixCountableRangeLazy 31 31 +0.0% 1.00x
PrefixSequence 1994 1993 -0.1% 1.00x (?)
PrefixSequenceLazy 2042 2041 -0.0% 1.00x (?)
PrefixWhileAnyCollection 138 138 +0.0% 1.00x
PrefixWhileAnyCollectionLazy 81 81 +0.0% 1.00x
PrefixWhileAnySeqCRangeIter 8098 8097 -0.0% 1.00x (?)
PrefixWhileAnySeqCRangeIterLazy 65 65 +0.0% 1.00x
PrefixWhileAnySeqCntRange 53 53 +0.0% 1.00x
PrefixWhileAnySeqCntRangeLazy 81 81 +0.0% 1.00x
PrefixWhileAnySequence 9360 9223 -1.5% 1.01x (?)
PrefixWhileArray 79 79 +0.0% 1.00x
PrefixWhileArrayLazy 63 63 +0.0% 1.00x
PrefixWhileCountableRange 33 33 +0.0% 1.00x
PrefixWhileCountableRangeLazy 31 31 +0.0% 1.00x
PrefixWhileSequence 322 323 +0.3% 1.00x (?)
PrefixWhileSequenceLazy 47 47 +0.0% 1.00x
Prims 822 815 -0.9% 1.01x (?)
PrimsSplit 823 815 -1.0% 1.01x (?)
QueueConcrete 1023 1023 +0.0% 1.00x
QueueGeneric 1023 1023 +0.0% 1.00x
RC4 150 150 +0.0% 1.00x
RGBHistogram 3530 3516 -0.4% 1.00x (?)
RGBHistogramOfObjects 21948 21881 -0.3% 1.00x (?)
RangeAssignment 316 315 -0.3% 1.00x (?)
RangeIterationSigned 154 154 +0.0% 1.00x
RangeReplaceableCollectionPlusDefault 877 881 +0.5% 1.00x (?)
RecursiveOwnedParameter 103 103 +0.0% 1.00x
RemoveWhereFilterInts 38 38 +0.0% 1.00x
RemoveWhereFilterString 291 291 +0.0% 1.00x
RemoveWhereFilterStrings 389 389 +0.0% 1.00x
RemoveWhereMoveInts 13 13 +0.0% 1.00x
RemoveWhereMoveStrings 633 633 +0.0% 1.00x
RemoveWhereQuadraticInts 1154 1155 +0.1% 1.00x (?)
RemoveWhereQuadraticString 435 434 -0.2% 1.00x (?)
RemoveWhereQuadraticStrings 2470 2468 -0.1% 1.00x (?)
RemoveWhereSwapInts 17 17 +0.0% 1.00x
RemoveWhereSwapStrings 768 768 +0.0% 1.00x
ReversedArray 51 51 +0.0% 1.00x
ReversedBidirectional 15051 15129 +0.5% 0.99x (?)
ReversedDictionary 278 277 -0.4% 1.00x (?)
RomanNumbers 126920 128906 +1.6% 0.98x (?)
SequenceAlgosAnySequence 10520 10617 +0.9% 0.99x
SequenceAlgosArray 1386 1387 +0.1% 1.00x (?)
SequenceAlgosContiguousArray 1386 1386 +0.0% 1.00x
SequenceAlgosList 1209 1209 +0.0% 1.00x
SequenceAlgosRange 2312 2311 -0.0% 1.00x (?)
SequenceAlgosUnfoldSequence 988 988 +0.0% 1.00x
SetExclusiveOr 5878 5914 +0.6% 0.99x (?)
SetExclusiveOr_OfObjects 10517 10525 +0.1% 1.00x (?)
SetIntersect 870 859 -1.3% 1.01x (?)
SetIntersect_OfObjects 1412 1384 -2.0% 1.02x (?)
SetIsSubsetOf 335 335 +0.0% 1.00x
SetIsSubsetOf_OfObjects 393 393 +0.0% 1.00x
SetUnion 5036 5006 -0.6% 1.01x (?)
SetUnion_OfObjects 9083 9049 -0.4% 1.00x (?)
SevenBoom 792 786 -0.8% 1.01x (?)
Sim2DArray 373 373 +0.0% 1.00x
SortLargeExistentials 5604 5547 -1.0% 1.01x (?)
SortLettersInPlace 945 942 -0.3% 1.00x (?)
SortSortedStrings 942 940 -0.2% 1.00x (?)
SortStrings 1912 1898 -0.7% 1.01x
SortStringsUnicode 2362 2394 +1.4% 0.99x
StackPromo 20086 20141 +0.3% 1.00x (?)
StaticArray 8 8 +0.0% 1.00x
StrComplexWalk 1601 1601 +0.0% 1.00x
StrToInt 2672 2573 -3.7% 1.04x
StringAdder 672 696 +3.6% 0.97x
StringBuilder 698 713 +2.1% 0.98x
StringBuilderLong 1130 1118 -1.1% 1.01x (?)
StringBuilderWithLongSubstring 1277 1273 -0.3% 1.00x (?)
StringComparison_abnormal 703 707 +0.6% 0.99x (?)
StringComparison_ascii 1194 1155 -3.3% 1.03x
StringComparison_emoji 736 719 -2.3% 1.02x (?)
StringComparison_fastPrenormal 763 742 -2.8% 1.03x
StringComparison_latin1 585 584 -0.2% 1.00x (?)
StringComparison_longSharedPrefix 840 835 -0.6% 1.01x (?)
StringComparison_nonBMPSlowestPrenormal 1454 1433 -1.4% 1.01x
StringComparison_slowerPrenormal 1562 1549 -0.8% 1.01x (?)
StringComparison_zalgo 111316 111837 +0.5% 1.00x (?)
StringEdits 152047 154342 +1.5% 0.99x (?)
StringEnumRawValueInitialization 757 752 -0.7% 1.01x (?)
StringEqualPointerComparison 256 256 +0.0% 1.00x
StringFromLongWholeSubstringGeneric 19 19 +0.0% 1.00x
StringHasPrefixAscii 1849 1875 +1.4% 0.99x
StringHasPrefixUnicode 99870 99932 +0.1% 1.00x (?)
StringHasSuffixAscii 1977 2003 +1.3% 0.99x
StringHasSuffixUnicode 102758 102454 -0.3% 1.00x (?)
StringInterpolation 9459 9403 -0.6% 1.01x (?)
StringInterpolationManySmallSegments 17649 17584 -0.4% 1.00x (?)
StringInterpolationSmall 5945 5946 +0.0% 1.00x (?)
StringMatch 10475 10550 +0.7% 0.99x (?)
StringRemoveDupes 627 630 +0.5% 1.00x (?)
StringUTF16Builder 2469 2464 -0.2% 1.00x (?)
StringUTF16SubstringBuilder 5213 5106 -2.1% 1.02x (?)
StringWalk 1289 1288 -0.1% 1.00x (?)
StringWithCString 36374 36430 +0.2% 1.00x (?)
StringWordBuilderReservingCapacity 1794 1728 -3.7% 1.04x
SubstringComparable 24 24 +0.0% 1.00x
SubstringEqualString 689 705 +2.3% 0.98x (?)
SubstringEquatable 1265 1259 -0.5% 1.00x (?)
SubstringFromLongString 9 9 +0.0% 1.00x
SubstringFromLongStringGeneric 67 67 +0.0% 1.00x
SuffixAnyCollection 28 27 -3.6% 1.04x (?)
SuffixAnyCollectionLazy 18604 18469 -0.7% 1.01x (?)
SuffixAnySeqCRangeIter 3446 3433 -0.4% 1.00x (?)
SuffixAnySeqCRangeIterLazy 3441 3434 -0.2% 1.00x (?)
SuffixAnySeqCntRange 18 18 +0.0% 1.00x
SuffixAnySeqCntRangeLazy 18 18 +0.0% 1.00x
SuffixAnySequence 4556 4556 +0.0% 1.00x
SuffixAnySequenceLazy 4634 4631 -0.1% 1.00x (?)
SuffixCountableRange 10 10 +0.0% 1.00x
SuffixCountableRangeLazy 10 10 +0.0% 1.00x
SuffixSequence 3312 3309 -0.1% 1.00x (?)
SuffixSequenceLazy 3304 3308 +0.1% 1.00x (?)
SumUsingReduce 91 91 +0.0% 1.00x
SumUsingReduceInto 87 87 +0.0% 1.00x
SuperChars 13163 13153 -0.1% 1.00x (?)
TwoSum 1554 1574 +1.3% 0.99x (?)
TypeFlood 0 0 +0.0% 1.00x
UTF8Decode 261 261 +0.0% 1.00x
Walsh 363 364 +0.3% 1.00x (?)
WordCountHistogramASCII 7418 7272 -2.0% 1.02x
WordCountHistogramUTF16 12918 12951 +0.3% 1.00x (?)
WordCountUniqueASCII 2252 2246 -0.3% 1.00x (?)
WordCountUniqueUTF16 6958 6919 -0.6% 1.01x (?)
WordSplitASCII 5947 5922 -0.4% 1.00x (?)
WordSplitUTF16 7527 7550 +0.3% 1.00x (?)
XorLoop 343 343 +0.0% 1.00x

Unoptimized (Onone)

Regression (7)
TEST OLD NEW DELTA SPEEDUP
DictionaryGroup 4054 4635 +14.3% 0.87x
StringWithCString 37068 40673 +9.7% 0.91x
TypeFlood 174 190 +9.2% 0.92x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 41432 44769 +8.1% 0.93x (?)
FloatingPointPrinting_Float_interpolated 62652 67307 +7.4% 0.93x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 40975 43976 +7.3% 0.93x (?)
DataAppendBytes 4620 4867 +5.3% 0.95x (?)
Improvement (56)
TEST OLD NEW DELTA SPEEDUP
PrefixWhileArrayLazy 13927 11034 -20.8% 1.26x
DropWhileArrayLazy 15818 12614 -20.3% 1.25x
ArrayAppendLazyMap 192310 153776 -20.0% 1.25x
MapReduceLazyCollection 25399 20540 -19.1% 1.24x
FatCompactMap 312567 263334 -15.8% 1.19x
RemoveWhereFilterString 1396 1181 -15.4% 1.18x
MapReduceLazyCollectionShort 34989 29871 -14.6% 1.17x
CharIteration_ascii_unicodeScalars_Backwards 263887 226395 -14.2% 1.17x (?)
FrequenciesUsingReduceInto 3298 2843 -13.8% 1.16x
Histogram 6717 5808 -13.5% 1.16x
CharIteration_tweet_unicodeScalars_Backwards 539528 467065 -13.4% 1.16x (?)
CharIteration_korean_unicodeScalars_Backwards 253774 219691 -13.4% 1.16x (?)
CharIteration_punctuated_unicodeScalars_Backwards 57183 49717 -13.1% 1.15x
CharIteration_japanese_unicodeScalars_Backwards 311158 270995 -12.9% 1.15x (?)
CharIteration_chinese_unicodeScalars_Backwards 196465 171137 -12.9% 1.15x (?)
CharIteration_russian_unicodeScalars_Backwards 215717 188574 -12.6% 1.14x (?)
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 45118 39475 -12.5% 1.14x
DropFirstArrayLazy 29990 26283 -12.4% 1.14x
CharIndexing_chinese_unicodeScalars_Backwards 278224 243845 -12.4% 1.14x
SubstringComparable 1687 1479 -12.3% 1.14x
PrefixArrayLazy 29793 26287 -11.8% 1.13x
CharIndexing_tweet_unicodeScalars 639081 565661 -11.5% 1.13x
ArrayOfPOD 758 678 -10.6% 1.12x
CharIndexing_ascii_unicodeScalars 319162 286012 -10.4% 1.12x
CharIndexing_japanese_unicodeScalars 382621 343239 -10.3% 1.11x (?)
CharIndexing_korean_unicodeScalars 309497 278136 -10.1% 1.11x (?)
CharIndexing_punctuated_unicodeScalars 70432 63548 -9.8% 1.11x
CharIndexing_russian_unicodeScalars 264022 238228 -9.8% 1.11x
CharIndexing_punctuatedJapanese_unicodeScalars 55877 50645 -9.4% 1.10x (?)
ArrayOfGenericPOD2 1114 1011 -9.2% 1.10x
CharIteration_utf16_unicodeScalars_Backwards 215720 196491 -8.9% 1.10x (?)
CharIndexing_chinese_unicodeScalars 237578 216448 -8.9% 1.10x (?)
CharIndexing_tweet_unicodeScalars_Backwards 705340 643025 -8.8% 1.10x (?)
CharIndexing_japanese_unicodeScalars_Backwards 424507 388005 -8.6% 1.09x (?)
RangeReplaceableCollectionPlusDefault 10753 9840 -8.5% 1.09x
CharIndexing_russian_unicodeScalars_Backwards 293692 268911 -8.4% 1.09x (?)
CharIndexing_ascii_unicodeScalars_Backwards 353188 323720 -8.3% 1.09x (?)
CharIndexing_korean_unicodeScalars_Backwards 342885 314589 -8.3% 1.09x (?)
LazilyFilteredArrayContains 731775 676140 -7.6% 1.08x
ObjectiveCBridgeStubToNSDate 14429 13388 -7.2% 1.08x (?)
CharIndexing_punctuated_unicodeScalars_Backwards 76713 71283 -7.1% 1.08x (?)
NSStringConversion 707 658 -6.9% 1.07x (?)
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 60894 56719 -6.9% 1.07x (?)
StringUTF16SubstringBuilder 22300 20816 -6.7% 1.07x (?)
StringBuilderWithLongSubstring 4592 4287 -6.6% 1.07x
CharIndexing_utf16_unicodeScalars 267232 249620 -6.6% 1.07x (?)
LazilyFilteredArrays 1379398 1288954 -6.6% 1.07x
StrToInt 74635 69934 -6.3% 1.07x (?)
Combos 2243 2108 -6.0% 1.06x (?)
CharIndexing_utf16_unicodeScalars_Backwards 291329 273903 -6.0% 1.06x (?)
StrComplexWalk 6516 6127 -6.0% 1.06x
SequenceAlgosArray 760306 716712 -5.7% 1.06x
RGBHistogram 23672 22368 -5.5% 1.06x
ObjectiveCBridgeToNSDictionary 24226 22929 -5.4% 1.06x (?)
StringInterpolation 10962 10394 -5.2% 1.05x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 65664 62277 -5.2% 1.05x (?)
No Changes (361)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 4791 4916 +2.6% 0.97x (?)
AnyHashableWithAClass 91593 93589 +2.2% 0.98x
Array2D 570095 570392 +0.1% 1.00x (?)
ArrayAppend 4169 4171 +0.0% 1.00x (?)
ArrayAppendArrayOfInt 730 729 -0.1% 1.00x (?)
ArrayAppendAscii 35379 35224 -0.4% 1.00x (?)
ArrayAppendFromGeneric 735 736 +0.1% 1.00x (?)
ArrayAppendGenericStructs 1272 1276 +0.3% 1.00x (?)
ArrayAppendLatin1 58085 57817 -0.5% 1.00x
ArrayAppendOptionals 1272 1275 +0.2% 1.00x (?)
ArrayAppendRepeatCol 163264 164939 +1.0% 0.99x
ArrayAppendReserved 3839 3841 +0.1% 1.00x (?)
ArrayAppendSequence 91990 93618 +1.8% 0.98x
ArrayAppendStrings 5663 5760 +1.7% 0.98x
ArrayAppendToFromGeneric 731 732 +0.1% 1.00x (?)
ArrayAppendToGeneric 736 743 +1.0% 0.99x
ArrayAppendUTF16 58186 57573 -1.1% 1.01x
ArrayInClass 5551 5584 +0.6% 0.99x (?)
ArrayLiteral 1616 1618 +0.1% 1.00x (?)
ArrayOfGenericRef 9655 9641 -0.1% 1.00x (?)
ArrayOfRef 8898 8913 +0.2% 1.00x (?)
ArrayPlusEqualArrayOfInt 732 734 +0.3% 1.00x (?)
ArrayPlusEqualFiveElementCollection 212083 214051 +0.9% 0.99x (?)
ArrayPlusEqualSingleElementCollection 210832 211486 +0.3% 1.00x (?)
ArrayPlusEqualThreeElements 8426 8404 -0.3% 1.00x (?)
ArraySubscript 96360 96913 +0.6% 0.99x (?)
ArrayValueProp 3281 3279 -0.1% 1.00x (?)
ArrayValueProp2 13704 13736 +0.2% 1.00x (?)
ArrayValueProp3 3762 3759 -0.1% 1.00x (?)
ArrayValueProp4 3704 3734 +0.8% 0.99x (?)
BinaryFloatingPointPropertiesBinade 79 77 -2.5% 1.03x
BinaryFloatingPointPropertiesNextUp 120 123 +2.5% 0.98x
BinaryFloatingPointPropertiesUlp 118 115 -2.5% 1.03x
BitCount 7976 7976 +0.0% 1.00x
ByteSwap 8654 8666 +0.1% 1.00x
COWTree 10565 10603 +0.4% 1.00x (?)
CSVParsing 2598616 2571233 -1.1% 1.01x (?)
CSVParsingAlt 1288769 1326482 +2.9% 0.97x (?)
CSVParsingAltIndices 2131638 2142476 +0.5% 0.99x (?)
CStringLongAscii 4826 4969 +3.0% 0.97x
CStringLongNonAscii 2302 2198 -4.5% 1.05x
CStringShortAscii 5639 5616 -0.4% 1.00x (?)
Calculator 1960 1936 -1.2% 1.01x
CaptureProp 248772 250184 +0.6% 0.99x (?)
ChainedFilterMap 220541 210229 -4.7% 1.05x
CharIteration_ascii_unicodeScalars 134679 134665 -0.0% 1.00x (?)
CharIteration_chinese_unicodeScalars 102014 101932 -0.1% 1.00x (?)
CharIteration_japanese_unicodeScalars 161383 161023 -0.2% 1.00x (?)
CharIteration_korean_unicodeScalars 130745 130703 -0.0% 1.00x (?)
CharIteration_punctuatedJapanese_unicodeScalars 24098 23918 -0.7% 1.01x
CharIteration_punctuated_unicodeScalars 30166 30216 +0.2% 1.00x (?)
CharIteration_russian_unicodeScalars 112328 112020 -0.3% 1.00x (?)
CharIteration_tweet_unicodeScalars 275570 277582 +0.7% 0.99x (?)
CharIteration_utf16_unicodeScalars 113672 113776 +0.1% 1.00x (?)
CharacterLiteralsLarge 5156 5160 +0.1% 1.00x (?)
CharacterLiteralsSmall 652 632 -3.1% 1.03x
CharacterPropertiesFetch 4822 4821 -0.0% 1.00x (?)
CharacterPropertiesPrecomputed 3270 3234 -1.1% 1.01x (?)
CharacterPropertiesStashed 2094 2100 +0.3% 1.00x (?)
CharacterPropertiesStashedMemo 3973 4032 +1.5% 0.99x (?)
Chars 32142 32071 -0.2% 1.00x
ClassArrayGetter 886 883 -0.3% 1.00x
DataAccessBytes 2153 2139 -0.7% 1.01x (?)
DataAppendArray 4920 4958 +0.8% 0.99x (?)
DataAppendDataLargeToLarge 60565 60409 -0.3% 1.00x (?)
DataAppendDataLargeToMedium 31868 31748 -0.4% 1.00x (?)
DataAppendDataLargeToSmall 30595 30704 +0.4% 1.00x (?)
DataAppendDataMediumToLarge 33381 33663 +0.8% 0.99x (?)
DataAppendDataMediumToMedium 6236 6109 -2.0% 1.02x (?)
DataAppendDataMediumToSmall 5441 5361 -1.5% 1.01x (?)
DataAppendDataSmallToLarge 32628 32674 +0.1% 1.00x (?)
DataAppendDataSmallToMedium 5544 5636 +1.7% 0.98x (?)
DataAppendDataSmallToSmall 5302 5331 +0.5% 0.99x (?)
DataAppendSequence 1700646 1710205 +0.6% 0.99x (?)
DataCopyBytes 2218 2245 +1.2% 0.99x (?)
DataCount 200 200 +0.0% 1.00x
DataMutateBytes 4764 4684 -1.7% 1.02x (?)
DataReplaceLarge 35870 35188 -1.9% 1.02x (?)
DataReplaceLargeBuffer 51688 52480 +1.5% 0.98x (?)
DataReplaceMedium 8046 8011 -0.4% 1.00x (?)
DataReplaceMediumBuffer 11765 11692 -0.6% 1.01x (?)
DataReplaceSmall 6090 6305 +3.5% 0.97x (?)
DataReplaceSmallBuffer 8012 8381 +4.6% 0.96x (?)
DataReset 2546 2654 +4.2% 0.96x (?)
DataSetCount 505 506 +0.2% 1.00x (?)
DataSubscript 398 398 +0.0% 1.00x
DictOfArraysToArrayOfDicts 3236 3088 -4.6% 1.05x (?)
Dictionary 2095 2084 -0.5% 1.01x (?)
Dictionary2 1324 1325 +0.1% 1.00x (?)
Dictionary2OfObjects 3826 3794 -0.8% 1.01x (?)
Dictionary3 797 800 +0.4% 1.00x (?)
Dictionary3OfObjects 1882 1882 +0.0% 1.00x
Dictionary4 1060 1064 +0.4% 1.00x (?)
Dictionary4Legacy 1374 1376 +0.1% 1.00x (?)
Dictionary4OfObjects 1556 1556 +0.0% 1.00x
Dictionary4OfObjectsLegacy 1938 1910 -1.4% 1.01x (?)
DictionaryBridge 1186 1198 +1.0% 0.99x (?)
DictionaryCopy 287720 289445 +0.6% 0.99x (?)
DictionaryFilter 299351 302644 +1.1% 0.99x (?)
DictionaryGroupOfObjects 6169 6141 -0.5% 1.00x (?)
DictionaryLiteral 7983 7991 +0.1% 1.00x (?)
DictionaryOfObjects 5193 5301 +2.1% 0.98x (?)
DictionaryRemove 16060 16063 +0.0% 1.00x (?)
DictionaryRemoveOfObjects 45772 45506 -0.6% 1.01x (?)
DictionarySubscriptDefaultMutation 1781 1807 +1.5% 0.99x (?)
DictionarySubscriptDefaultMutationArray 2032 2029 -0.1% 1.00x (?)
DictionarySubscriptDefaultMutationArrayOfObjects 8228 8214 -0.2% 1.00x (?)
DictionarySubscriptDefaultMutationOfObjects 4784 4581 -4.2% 1.04x (?)
DictionarySwap 4733 4739 +0.1% 1.00x (?)
DictionarySwapAt 32383 31833 -1.7% 1.02x (?)
DictionarySwapAtOfObjects 101337 101664 +0.3% 1.00x (?)
DictionarySwapOfObjects 16415 16452 +0.2% 1.00x (?)
DoubleWidthDivision 0 0 +0.0% 1.00x
DropFirstAnyCollection 13757 13959 +1.5% 0.99x
DropFirstAnyCollectionLazy 92733 95219 +2.7% 0.97x (?)
DropFirstAnySeqCRangeIter 21122 21380 +1.2% 0.99x
DropFirstAnySeqCRangeIterLazy 21148 21372 +1.1% 0.99x (?)
DropFirstAnySeqCntRange 13766 13837 +0.5% 0.99x (?)
DropFirstAnySeqCntRangeLazy 13744 13831 +0.6% 0.99x (?)
DropFirstAnySequence 11543 11595 +0.5% 1.00x (?)
DropFirstAnySequenceLazy 11488 11554 +0.6% 0.99x (?)
DropFirstArray 3062 3077 +0.5% 1.00x
DropFirstCountableRange 289 289 +0.0% 1.00x
DropFirstCountableRangeLazy 30500 30569 +0.2% 1.00x
DropFirstSequence 11118 11253 +1.2% 0.99x
DropFirstSequenceLazy 11161 11238 +0.7% 0.99x
DropLastAnyCollection 4595 4630 +0.8% 0.99x (?)
DropLastAnyCollectionLazy 30954 29785 -3.8% 1.04x (?)
DropLastAnySeqCRangeIter 36607 36681 +0.2% 1.00x (?)
DropLastAnySeqCRangeIterLazy 36549 36701 +0.4% 1.00x (?)
DropLastAnySeqCntRange 4583 4649 +1.4% 0.99x (?)
DropLastAnySeqCntRangeLazy 4588 4631 +0.9% 0.99x
DropLastAnySequence 27638 27677 +0.1% 1.00x (?)
DropLastAnySequenceLazy 27648 27769 +0.4% 1.00x (?)
DropLastCountableRange 100 100 +0.0% 1.00x
DropLastCountableRangeLazy 10141 10145 +0.0% 1.00x (?)
DropLastSequence 27540 27740 +0.7% 0.99x (?)
DropLastSequenceLazy 27635 27752 +0.4% 1.00x (?)
DropWhileAnyCollection 17755 17922 +0.9% 0.99x
DropWhileAnyCollectionLazy 20150 20243 +0.5% 1.00x (?)
DropWhileAnySeqCRangeIter 21900 22128 +1.0% 0.99x
DropWhileAnySeqCRangeIterLazy 20080 20161 +0.4% 1.00x
DropWhileAnySeqCntRange 17744 17889 +0.8% 0.99x
DropWhileAnySeqCntRangeLazy 19979 20163 +0.9% 0.99x
DropWhileAnySequence 12203 12284 +0.7% 0.99x (?)
DropWhileAnySequenceLazy 11111 11161 +0.5% 1.00x (?)
DropWhileCountableRange 4339 4377 +0.9% 0.99x
DropWhileCountableRangeLazy 19717 19847 +0.7% 0.99x
DropWhileSequence 11868 11873 +0.0% 1.00x (?)
DropWhileSequenceLazy 10793 10822 +0.3% 1.00x (?)
EqualStringSubstring 64 64 +0.0% 1.00x
EqualSubstringString 65 64 -1.5% 1.02x
EqualSubstringSubstring 65 65 +0.0% 1.00x
EqualSubstringSubstringGenericEquatable 53 53 +0.0% 1.00x
ErrorHandling 6320 6162 -2.5% 1.03x (?)
ExclusivityGlobal 174 167 -4.0% 1.04x (?)
ExclusivityIndependent 66 66 +0.0% 1.00x
FilterEvenUsingReduce 3219 3229 +0.3% 1.00x (?)
FilterEvenUsingReduceInto 1692 1684 -0.5% 1.00x (?)
FloatingPointPrinting_Double_description_small 21821 21774 -0.2% 1.00x (?)
FloatingPointPrinting_Double_description_uniform 32168 32732 +1.8% 0.98x (?)
FloatingPointPrinting_Double_interpolated 92453 94627 +2.4% 0.98x (?)
FloatingPointPrinting_Float80_description_small 28061 28135 +0.3% 1.00x (?)
FloatingPointPrinting_Float80_description_uniform 52634 54107 +2.8% 0.97x (?)
FloatingPointPrinting_Float80_interpolated 115716 110389 -4.6% 1.05x (?)
FloatingPointPrinting_Float_description_small 6078 6203 +2.1% 0.98x
FloatingPointPrinting_Float_description_uniform 15231 15696 +3.1% 0.97x
FrequenciesUsingReduce 9974 10133 +1.6% 0.98x (?)
Hanoi 18532 18286 -1.3% 1.01x
HashTest 19130 18841 -1.5% 1.02x (?)
Integrate 415 413 -0.5% 1.00x (?)
IterateData 4855 4915 +1.2% 0.99x
Join 699 706 +1.0% 0.99x (?)
LazilyFilteredRange 477854 480348 +0.5% 0.99x (?)
LessSubstringSubstring 65 65 +0.0% 1.00x
LessSubstringSubstringGenericComparable 53 53 +0.0% 1.00x
LinkedList 29090 29111 +0.1% 1.00x (?)
LuhnAlgoEager 5101 5045 -1.1% 1.01x (?)
LuhnAlgoLazy 5177 5153 -0.5% 1.00x (?)
MapReduce 22946 22870 -0.3% 1.00x (?)
MapReduceAnyCollection 22920 22843 -0.3% 1.00x (?)
MapReduceAnyCollectionShort 34373 34257 -0.3% 1.00x (?)
MapReduceClass 26617 26481 -0.5% 1.01x
MapReduceClassShort 37708 36483 -3.2% 1.03x (?)
MapReduceLazySequence 18531 18620 +0.5% 1.00x (?)
MapReduceSequence 27561 27463 -0.4% 1.00x (?)
MapReduceShort 34276 33646 -1.8% 1.02x (?)
MapReduceShortString 221 214 -3.2% 1.03x (?)
MapReduceString 1565 1558 -0.4% 1.00x (?)
Memset 39594 39584 -0.0% 1.00x (?)
MonteCarloE 1031338 1038065 +0.7% 0.99x
MonteCarloPi 4646289 4675829 +0.6% 0.99x
NSDictionaryCastToSwift 5848 5810 -0.6% 1.01x (?)
NSError 544 554 +1.8% 0.98x (?)
NibbleSort 446091 449070 +0.7% 0.99x
NopDeinit 177848 169920 -4.5% 1.05x (?)
ObjectAllocation 1123 1128 +0.4% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObject 26160 25974 -0.7% 1.01x (?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 8621 8287 -3.9% 1.04x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 107996 104535 -3.2% 1.03x (?)
ObjectiveCBridgeFromNSSetAnyObject 49431 50301 +1.8% 0.98x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 5238 5285 +0.9% 0.99x (?)
ObjectiveCBridgeFromNSString 2579 2588 +0.3% 1.00x (?)
ObjectiveCBridgeFromNSStringForced 2525 2496 -1.1% 1.01x (?)
ObjectiveCBridgeStubDataAppend 5740 5724 -0.3% 1.00x (?)
ObjectiveCBridgeStubDateMutation 694 694 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 29380 29566 +0.6% 0.99x (?)
ObjectiveCBridgeStubFromNSDate 6327 6276 -0.8% 1.01x (?)
ObjectiveCBridgeStubFromNSString 988 953 -3.5% 1.04x (?)
ObjectiveCBridgeStubFromNSStringRef 176 177 +0.6% 0.99x
ObjectiveCBridgeStubNSDataAppend 2793 2739 -1.9% 1.02x (?)
ObjectiveCBridgeStubNSDateMutationRef 14280 14299 +0.1% 1.00x (?)
ObjectiveCBridgeStubToArrayOfNSString 34791 34882 +0.3% 1.00x (?)
ObjectiveCBridgeStubToNSDateRef 3112 3133 +0.7% 0.99x (?)
ObjectiveCBridgeStubToNSString 2162 2167 +0.2% 1.00x (?)
ObjectiveCBridgeStubToNSStringRef 140 140 +0.0% 1.00x
ObjectiveCBridgeStubURLAppendPath 268905 267088 -0.7% 1.01x (?)
ObjectiveCBridgeStubURLAppendPathRef 274349 268056 -2.3% 1.02x (?)
ObjectiveCBridgeToNSArray 13288 12796 -3.7% 1.04x (?)
ObjectiveCBridgeToNSSet 15098 15675 +3.8% 0.96x (?)
ObjectiveCBridgeToNSString 476 477 +0.2% 1.00x (?)
ObserverClosure 5873 5935 +1.1% 0.99x
ObserverForwarderStruct 3870 3841 -0.7% 1.01x
ObserverPartiallyAppliedMethod 7168 7184 +0.2% 1.00x (?)
ObserverUnappliedMethod 7561 7512 -0.6% 1.01x (?)
OpenClose 803 800 -0.4% 1.00x (?)
PartialApplyDynamicType 35774 36690 +2.6% 0.98x
Phonebook 17452 17213 -1.4% 1.01x
PointerArithmetics 110438 105301 -4.7% 1.05x
PolymorphicCalls 2198 2192 -0.3% 1.00x (?)
PopFrontArray 4177 4188 +0.3% 1.00x (?)
PopFrontArrayGeneric 4823 4880 +1.2% 0.99x (?)
PopFrontUnsafePointer 9528 9558 +0.3% 1.00x (?)
PrefixAnyCollection 13754 13864 +0.8% 0.99x
PrefixAnyCollectionLazy 90782 89039 -1.9% 1.02x (?)
PrefixAnySeqCRangeIter 16793 17027 +1.4% 0.99x (?)
PrefixAnySeqCRangeIterLazy 16854 17035 +1.1% 0.99x
PrefixAnySeqCntRange 13728 13969 +1.8% 0.98x
PrefixAnySeqCntRangeLazy 13717 13881 +1.2% 0.99x
PrefixAnySequence 9408 9529 +1.3% 0.99x
PrefixAnySequenceLazy 9346 9522 +1.9% 0.98x
PrefixArray 3084 3079 -0.2% 1.00x
PrefixCountableRange 289 289 +0.0% 1.00x
PrefixCountableRangeLazy 30549 30564 +0.0% 1.00x (?)
PrefixSequence 9098 9083 -0.2% 1.00x (?)
PrefixSequenceLazy 9041 9113 +0.8% 0.99x
PrefixWhileAnyCollection 25764 25991 +0.9% 0.99x
PrefixWhileAnyCollectionLazy 16601 16704 +0.6% 0.99x
PrefixWhileAnySeqCRangeIter 30883 30944 +0.2% 1.00x (?)
PrefixWhileAnySeqCRangeIterLazy 16467 16702 +1.4% 0.99x
PrefixWhileAnySeqCntRange 25733 25949 +0.8% 0.99x
PrefixWhileAnySeqCntRangeLazy 16548 16679 +0.8% 0.99x
PrefixWhileAnySequence 23995 24080 +0.4% 1.00x (?)
PrefixWhileAnySequenceLazy 9750 9954 +2.1% 0.98x
PrefixWhileArray 9461 9430 -0.3% 1.00x (?)
PrefixWhileCountableRange 12316 12411 +0.8% 0.99x
PrefixWhileCountableRangeLazy 16217 16445 +1.4% 0.99x
PrefixWhileSequence 23687 23884 +0.8% 0.99x
PrefixWhileSequenceLazy 9599 9658 +0.6% 0.99x (?)
Prims 8659 8656 -0.0% 1.00x (?)
PrimsSplit 8508 8595 +1.0% 0.99x (?)
QueueConcrete 12788 12868 +0.6% 0.99x (?)
QueueGeneric 17570 16834 -4.2% 1.04x
RC4 14946 14636 -2.1% 1.02x (?)
RGBHistogramOfObjects 72539 69099 -4.7% 1.05x
RangeAssignment 2400 2372 -1.2% 1.01x (?)
RangeIterationSigned 13038 13328 +2.2% 0.98x (?)
RecursiveOwnedParameter 5506 5751 +4.4% 0.96x
RemoveWhereFilterInts 1863 1866 +0.2% 1.00x (?)
RemoveWhereFilterStrings 2330 2329 -0.0% 1.00x (?)
RemoveWhereMoveInts 3234 3190 -1.4% 1.01x (?)
RemoveWhereMoveStrings 3691 3726 +0.9% 0.99x (?)
RemoveWhereQuadraticInts 7236 7213 -0.3% 1.00x (?)
RemoveWhereQuadraticString 2087 2082 -0.2% 1.00x (?)
RemoveWhereQuadraticStrings 9128 9122 -0.1% 1.00x (?)
RemoveWhereSwapInts 5528 5586 +1.0% 0.99x (?)
RemoveWhereSwapStrings 6235 6218 -0.3% 1.00x (?)
ReversedArray 11839 11799 -0.3% 1.00x (?)
ReversedBidirectional 39852 39209 -1.6% 1.02x (?)
ReversedDictionary 20628 20459 -0.8% 1.01x
RomanNumbers 1189303 1218310 +2.4% 0.98x (?)
SequenceAlgosAnySequence 11645 11731 +0.7% 0.99x
SequenceAlgosContiguousArray 256016 255821 -0.1% 1.00x (?)
SequenceAlgosList 7846 7861 +0.2% 1.00x (?)
SequenceAlgosRange 1146451 1151765 +0.5% 1.00x (?)
SequenceAlgosUnfoldSequence 5792 5845 +0.9% 0.99x (?)
SetExclusiveOr 15244 15253 +0.1% 1.00x (?)
SetExclusiveOr_OfObjects 35224 35076 -0.4% 1.00x (?)
SetIntersect 6133 6205 +1.2% 0.99x (?)
SetIntersect_OfObjects 8706 8742 +0.4% 1.00x (?)
SetIsSubsetOf 1067 1081 +1.3% 0.99x
SetIsSubsetOf_OfObjects 1935 1918 -0.9% 1.01x (?)
SetUnion 10990 11032 +0.4% 1.00x (?)
SetUnion_OfObjects 25429 25172 -1.0% 1.01x (?)
SevenBoom 960 978 +1.9% 0.98x (?)
Sim2DArray 38930 38932 +0.0% 1.00x (?)
SortLargeExistentials 10457 10466 +0.1% 1.00x (?)
SortLettersInPlace 1728 1741 +0.8% 0.99x (?)
SortSortedStrings 1064 1023 -3.9% 1.04x
SortStrings 2139 2073 -3.1% 1.03x
SortStringsUnicode 2593 2552 -1.6% 1.02x
StackPromo 88062 88463 +0.5% 1.00x (?)
StaticArray 2258 2247 -0.5% 1.00x (?)
StringAdder 1054 1088 +3.2% 0.97x
StringBuilder 4972 4961 -0.2% 1.00x (?)
StringBuilderLong 2654 2621 -1.2% 1.01x (?)
StringComparison_abnormal 1184 1193 +0.8% 0.99x (?)
StringComparison_ascii 8518 8516 -0.0% 1.00x (?)
StringComparison_emoji 1789 1783 -0.3% 1.00x (?)
StringComparison_fastPrenormal 4455 4446 -0.2% 1.00x (?)
StringComparison_latin1 3466 3468 +0.1% 1.00x (?)
StringComparison_longSharedPrefix 2134 2130 -0.2% 1.00x (?)
StringComparison_nonBMPSlowestPrenormal 3310 3287 -0.7% 1.01x (?)
StringComparison_slowerPrenormal 3739 3727 -0.3% 1.00x (?)
StringComparison_zalgo 114824 114250 -0.5% 1.01x (?)
StringEdits 359037 350324 -2.4% 1.02x (?)
StringEnumRawValueInitialization 30163 29946 -0.7% 1.01x (?)
StringEqualPointerComparison 1421 1446 +1.8% 0.98x
StringFromLongWholeSubstring 11 11 +0.0% 1.00x
StringFromLongWholeSubstringGeneric 181 181 +0.0% 1.00x
StringHasPrefixAscii 2774 2826 +1.9% 0.98x
StringHasPrefixUnicode 104902 104748 -0.1% 1.00x (?)
StringHasSuffixAscii 2879 2957 +2.7% 0.97x
StringHasSuffixUnicode 95583 95327 -0.3% 1.00x (?)
StringInterpolationManySmallSegments 18672 18845 +0.9% 0.99x (?)
StringInterpolationSmall 7996 7647 -4.4% 1.05x (?)
StringMatch 35944 36889 +2.6% 0.97x (?)
StringRemoveDupes 651 637 -2.2% 1.02x
StringUTF16Builder 7579 7372 -2.7% 1.03x (?)
StringWalk 11314 11095 -1.9% 1.02x
StringWordBuilder 2285 2394 +4.8% 0.95x
StringWordBuilderReservingCapacity 1911 1825 -4.5% 1.05x
SubstringEqualString 1566 1530 -2.3% 1.02x (?)
SubstringEquatable 5126 4890 -4.6% 1.05x
SubstringFromLongString 16 16 +0.0% 1.00x
SubstringFromLongStringGeneric 94 94 +0.0% 1.00x
SuffixAnyCollection 4591 4641 +1.1% 0.99x (?)
SuffixAnyCollectionLazy 30209 29761 -1.5% 1.02x (?)
SuffixAnySeqCRangeIter 32981 33091 +0.3% 1.00x (?)
SuffixAnySeqCRangeIterLazy 32585 32701 +0.4% 1.00x
SuffixAnySeqCntRange 4583 4614 +0.7% 0.99x (?)
SuffixAnySeqCntRangeLazy 4594 4638 +1.0% 0.99x
SuffixAnySequence 23893 24166 +1.1% 0.99x
SuffixAnySequenceLazy 23833 23900 +0.3% 1.00x
SuffixCountableRange 100 100 +0.0% 1.00x
SuffixCountableRangeLazy 10147 10153 +0.1% 1.00x (?)
SuffixSequence 23786 23850 +0.3% 1.00x (?)
SuffixSequenceLazy 23729 23737 +0.0% 1.00x (?)
SumUsingReduce 143180 142776 -0.3% 1.00x (?)
SumUsingReduceInto 137668 138620 +0.7% 0.99x
SuperChars 75594 75703 +0.1% 1.00x (?)
TwoSum 3371 3372 +0.0% 1.00x (?)
UTF8Decode 27269 27297 +0.1% 1.00x (?)
Walsh 10706 10736 +0.3% 1.00x (?)
WordCountHistogramASCII 35384 34472 -2.6% 1.03x (?)
WordCountHistogramUTF16 41904 41390 -1.2% 1.01x (?)
WordCountUniqueASCII 6687 6647 -0.6% 1.01x
WordCountUniqueUTF16 11564 11514 -0.4% 1.00x (?)
WordSplitASCII 8907 8629 -3.1% 1.03x (?)
WordSplitUTF16 10834 10536 -2.8% 1.03x
XorLoop 20955 20830 -0.6% 1.01x
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


Storage *allocate(size_t capacity) {
auto size = sizeof(Storage) + (capacity - 1) * sizeof(Storage().Elem);
auto *ptr = reinterpret_cast<Storage *>(malloc(size));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth checking if malloc failed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely!

auto *storage = Elements.load(std::memory_order_relaxed);
if (storage == nullptr) {
storage = allocate(16);
Capacity = 16;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this a seqcst write? (And below too, and the various reads of Capacity and storage->Count) In fact, I suspect Capacity doesn't need to be atomic at all, since it's protected by WriterLock like FreeList?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I really have no idea why I made Capacity atomic. I blame my cat.

ScopedLock guard(WriterLock);

auto *storage = Elements.load(std::memory_order_relaxed);
if (storage == nullptr) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two branches could possibly be combined:

auto count = storage ? storage->Count : 0;
if (count >= Capacity) {
    auto newCapacity = min(16, count * 2);
    auto *newStorage = allocate(newCapacity);
    if (storage) {
        std::copy(storage->data(), storage->data() + count, newStorage->data());
        FreeList.push_back(storage);
    }
    storage = newStorage;
    Capacity = newCapacity;
    Elements.store(storage, std::memory_order_release);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's good, better than my way.

@tkremenek
Copy link
Member

Should this also be benchmarked on Linux?

…k for malloc failure. Use placement new when appending values.

rdar://problem/37173156
@mikeash
Copy link
Contributor Author

mikeash commented May 1, 2018

Benchmarking on Linux would be good, but it seems we don't have automation set up for that.

@mikeash
Copy link
Contributor Author

mikeash commented May 1, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented May 1, 2018

Build failed
Swift Test Linux Platform
Git Sha - 8b59295

@swift-ci
Copy link
Contributor

swift-ci commented May 1, 2018

Build failed
Swift Test OS X Platform
Git Sha - 8b59295

if (count >= Capacity) {
auto newCapacity = std::max((size_t)16, count * 2);
auto *newStorage = allocate(newCapacity);
if (storage) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch needs to set newStorage->Count.

Elements.store(storage, std::memory_order_release);
}

auto Count = storage->Count.load(std::memory_order_relaxed);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be reloaded? I think the other count will have the same value purpose, because there can't be concurrent modifications to storage->Count.


decltype(f(nullptr, 0)) result = f(ptr, count);

ReaderCount.fetch_sub(1, std::memory_order_relaxed);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My impression is that this should be release (and the load in push_back above an acquire), so that there's a barrier for fs reads and thus ensure that they have finished before calling deallocate? Or am I missing something?

Hm, now that I think about it, the fetch_add on ReaderCount above should probably also be acquire, because I don't think there's anything stopping that being moved all the way past the Count load and past the f call. (I may be misremembering something special about atomic accesses before acquire ones, though.)

mikeash added 2 commits May 9, 2018 15:23
…rentReadableArray. Remove a redundant load of Count. Fix memory ordering on ReaderCount.

rdar://problem/37173156
@mikeash
Copy link
Contributor Author

mikeash commented May 9, 2018

@huonw Thanks, I'm finally coming back to this and I fixed the stuff you pointed out. I think your evaluation of the memory ordering is correct. I would greatly appreciate if you could double-check the fixes in case I messed anything else up. This stuff is sorta hard!

@mikeash
Copy link
Contributor Author

mikeash commented May 11, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 68adaeb

@mikeash mikeash requested a review from gparker42 May 11, 2018 17:43
Mutex WriterLock;
std::vector<Storage *> FreeList;

Storage *allocate(size_t capacity) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allocate should be a static function of struct Storage. We don't want it to touch any existing fields.

return ptr;
}

void deallocate(Storage *storage) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deallocate should be a member of struct Storage. We don't want it to access the fields of any ConcurrentReadableArray.

/// An append-only array that can be read without taking locks. Writes
/// are still locked and serialized, but only with respect to other
/// writes.
template <class ElemTy> struct ConcurrentReadableArray {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type should be no-assign no-copy no-delete. (I don't remember how those are expressed in Swift's C++ code.)

/// `read` was called. The pointer becomes invalid after `f` returns.
template <class F> auto read(F f) -> decltype(f(nullptr, 0)) {
ReaderCount.fetch_add(1, std::memory_order_acquire);
auto *storage = Elements.load(std::memory_order_consume);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that current compilers implement memory_order_consume as memory_order_acquire, which is unnecessarily expensive on some CPUs. If this code is sufficiently performance-sensitive then it might need to use SWIFT_MEMORY_ORDER_CONSUME instead. (That macro expands to memory_order_relaxed and we (1) abandon DEC Alpha compatibility and (2) cross our fingers that the compiler doesn't break anything.)

ReaderCount.fetch_add(1, std::memory_order_acquire);
auto *storage = Elements.load(std::memory_order_consume);
auto count = storage->Count.load(std::memory_order_acquire);
auto *ptr = storage->data();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think making this const auto *ptr would force the reader function to use a pointer to const elements, which would help prevent thread-unsafe writes inside the reader function.

…s into Storage. Mark ConcurrentReadableArray as un-copyable, un-assignable, and un-movable. Use SWIFT_MEMORY_ORDER_CONSUME instead of std::memory_order_consume. Make read() pass a const pointer.

rdar://problem/37173156
@mikeash
Copy link
Contributor Author

mikeash commented May 15, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 68adaeb

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 68adaeb

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