Skip to content

GenericSpecializer: Allow simple function specialization cycles. #17885

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
Jul 12, 2018

Conversation

eeckstein
Copy link
Contributor

So far we immediately bailed once we detect a cycle in specializations. But it turned out that this prevented efficient code generation for some stdlib functions like compactMap.
With this change we allow specialization of cycles up to a depth of 1 (= still very limited to prevent code size explosion in some corner cases).

The effect of this optimization is tested with the existing benchmark FatCompactMap.

SR-7952, rdar://problem/41005326

This PR also fixes a related test.

The test worked but didn't test what it should test.
So far we immediately bailed once we detect a cycle in specializations. But it turned out that this prevented efficient code generation for some stdlib functions like compactMap.
With this change we allow specialization of cycles up to a depth of 1 (= still very limited to prevent code size explosion in some corner cases).

The effect of this optimization is tested with the existing benchmark FatCompactMap.

SR-7952, rdar://problem/41005326
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@eeckstein
Copy link
Contributor Author

@swift-ci smoke benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (45)
TEST OLD NEW DELTA SPEEDUP
DataAppendDataSmallToLarge 38008 65610 +72.6% 0.58x (?)
Sim2DArray 417 599 +43.6% 0.70x
DictionarySwapAt 6696 8756 +30.8% 0.76x
BinaryFloatingPointPropertiesBinade 25 31 +24.0% 0.81x
DataCopyBytes 440 509 +15.7% 0.86x
MapReduceLazyCollectionShort 34 38 +11.8% 0.89x
SuffixCountableRange 11 12 +9.1% 0.92x
SuffixCountableRangeLazy 11 12 +9.1% 0.92x
DropLastCountableRangeLazy 11 12 +9.1% 0.92x
DataCount 34 37 +8.8% 0.92x
RandomDoubleLCG 2172 2348 +8.1% 0.93x
RC4 149 161 +8.1% 0.93x
CharIteration_utf16_unicodeScalars_Backwards 17809 19224 +7.9% 0.93x
Calculator 191 206 +7.9% 0.93x
DataSetCount 565 606 +7.3% 0.93x (?)
NopDeinit 30165 32275 +7.0% 0.93x
Histogram 645 690 +7.0% 0.93x
MapReduce 373 399 +7.0% 0.93x
StringBuilderWithLongSubstring 1441 1539 +6.8% 0.94x (?)
CharIndexing_tweet_unicodeScalars 32054 34073 +6.3% 0.94x (?)
CharIteration_japanese_unicodeScalars 24358 25883 +6.3% 0.94x
CharIteration_tweet_unicodeScalars 40166 42674 +6.2% 0.94x
ObjectiveCBridgeFromNSArrayAnyObjectForced 4967 5277 +6.2% 0.94x (?)
CharIteration_russian_unicodeScalars 16935 17989 +6.2% 0.94x
DropFirstAnyCollectionLazy 64727 68730 +6.2% 0.94x
CharIteration_ascii_unicodeScalars_Backwards 14741 15609 +5.9% 0.94x
DictionaryRemove 4199 4445 +5.9% 0.94x
FrequenciesUsingReduce 4869 5154 +5.9% 0.94x
CharIteration_tweet_unicodeScalars_Backwards 29116 30796 +5.8% 0.95x
CharIteration_japanese_unicodeScalars_Backwards 17647 18658 +5.7% 0.95x
CharIndexing_ascii_unicodeScalars 16276 17203 +5.7% 0.95x (?)
CharIteration_chinese_unicodeScalars_Backwards 11175 11806 +5.6% 0.95x
DataAppendArray 5228 5523 +5.6% 0.95x (?)
CharIteration_russian_unicodeScalars_Backwards 12301 12993 +5.6% 0.95x
CharIteration_punctuated_unicodeScalars 4578 4835 +5.6% 0.95x
CharIteration_korean_unicodeScalars_Backwards 14312 15114 +5.6% 0.95x
CharIteration_ascii_unicodeScalars 20471 21608 +5.6% 0.95x
CharIteration_korean_unicodeScalars 19850 20951 +5.5% 0.95x
CharIndexing_japanese_unicodeScalars 19468 20546 +5.5% 0.95x
CharIndexing_korean_unicodeScalars 15767 16637 +5.5% 0.95x
CharIteration_punctuated_unicodeScalars_Backwards 3350 3533 +5.5% 0.95x
CharIteration_chinese_unicodeScalars 15504 16350 +5.5% 0.95x
UTF8Decode 296 312 +5.4% 0.95x
ObjectiveCBridgeToNSArray 14940 15741 +5.4% 0.95x (?)
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 2680 2823 +5.3% 0.95x
Improvement (18)
TEST OLD NEW DELTA SPEEDUP
FatCompactMap 200290 1247 -99.4% 160.62x
RangeIterationSigned 200 171 -14.5% 1.17x
ChainedFilterMap 1408 1250 -11.2% 1.13x
StaticArray 10 9 -10.0% 1.11x
StringEqualPointerComparison 315 286 -9.2% 1.10x
PointerArithmetics 34373 31501 -8.4% 1.09x
DataReplaceSmallBuffer 9088 8365 -8.0% 1.09x
MapReduceAnyCollection 399 371 -7.0% 1.08x
CharIndexing_japanese_unicodeScalars_Backwards 21164 19698 -6.9% 1.07x (?)
RemoveWhereMoveInts 15 14 -6.7% 1.07x
UTF8Decode_InitFromBytes_ascii 548 512 -6.6% 1.07x (?)
FilterEvenUsingReduce 1423 1335 -6.2% 1.07x
ObjectiveCBridgeStubToNSDate 15869 14948 -5.8% 1.06x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 5248 4949 -5.7% 1.06x
BinaryFloatingPointPropertiesUlp 37 35 -5.4% 1.06x
ObjectiveCBridgeToNSDictionary 28032 26533 -5.3% 1.06x (?)
ObjectiveCBridgeStubFromArrayOfNSString 34819 32992 -5.2% 1.06x (?)
SumUsingReduce 102 97 -4.9% 1.05x
No Changes (395)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 3828 3815 -0.3% 1.00x (?)
AnyHashableWithAClass 91022 91109 +0.1% 1.00x (?)
Array2D 2860 2859 -0.0% 1.00x (?)
ArrayAppend 1113 1112 -0.1% 1.00x (?)
ArrayAppendArrayOfInt 795 798 +0.4% 1.00x (?)
ArrayAppendAscii 3912 3867 -1.2% 1.01x (?)
ArrayAppendAsciiSubstring 24889 24865 -0.1% 1.00x (?)
ArrayAppendFromGeneric 798 801 +0.4% 1.00x (?)
ArrayAppendGenericStructs 1429 1429 +0.0% 1.00x
ArrayAppendLatin1 42105 41731 -0.9% 1.01x (?)
ArrayAppendLatin1Substring 141702 141825 +0.1% 1.00x (?)
ArrayAppendLazyMap 1346 1345 -0.1% 1.00x (?)
ArrayAppendOptionals 1402 1398 -0.3% 1.00x (?)
ArrayAppendRepeatCol 1342 1341 -0.1% 1.00x (?)
ArrayAppendReserved 841 842 +0.1% 1.00x (?)
ArrayAppendSequence 1121 1121 +0.0% 1.00x
ArrayAppendStrings 6337 6341 +0.1% 1.00x (?)
ArrayAppendToFromGeneric 794 798 +0.5% 0.99x (?)
ArrayAppendToGeneric 803 790 -1.6% 1.02x (?)
ArrayAppendUTF16 42203 41477 -1.7% 1.02x
ArrayAppendUTF16Substring 140454 140750 +0.2% 1.00x
ArrayInClass 86 86 +0.0% 1.00x
ArrayLiteral 0 0 +0.0% 1.00x
ArrayOfGenericPOD2 151 151 +0.0% 1.00x
ArrayOfGenericRef 4377 4389 +0.3% 1.00x (?)
ArrayOfPOD 184 184 +0.0% 1.00x
ArrayOfRef 4400 4380 -0.5% 1.00x (?)
ArrayPlusEqualArrayOfInt 798 794 -0.5% 1.01x (?)
ArrayPlusEqualFiveElementCollection 5603 5576 -0.5% 1.00x (?)
ArrayPlusEqualSingleElementCollection 1112 1112 +0.0% 1.00x
ArrayPlusEqualThreeElements 1666 1655 -0.7% 1.01x (?)
ArraySubscript 1552 1583 +2.0% 0.98x
ArrayValueProp 8 8 +0.0% 1.00x
ArrayValueProp2 8 8 +0.0% 1.00x
ArrayValueProp3 8 8 +0.0% 1.00x
ArrayValueProp4 8 8 +0.0% 1.00x
BinaryFloatingPointPropertiesNextUp 28 28 +0.0% 1.00x
BitCount 202 211 +4.5% 0.96x
ByteSwap 105 106 +1.0% 0.99x
COWArrayGuaranteedParameterOverhead 8810 8844 +0.4% 1.00x (?)
COWTree 3811 3678 -3.5% 1.04x (?)
CSVParsing 752244 751276 -0.1% 1.00x (?)
CSVParsingAlt 820819 818945 -0.2% 1.00x (?)
CSVParsingAltIndices 344358 341112 -0.9% 1.01x
CStringLongAscii 4120 4113 -0.2% 1.00x (?)
CStringLongNonAscii 2323 2326 +0.1% 1.00x (?)
CStringShortAscii 3352 3341 -0.3% 1.00x (?)
CaptureProp 4109 4098 -0.3% 1.00x
CharIndexing_ascii_unicodeScalars_Backwards 16082 16455 +2.3% 0.98x
CharIndexing_chinese_unicodeScalars 12631 13278 +5.1% 0.95x (?)
CharIndexing_chinese_unicodeScalars_Backwards 12238 12454 +1.8% 0.98x
CharIndexing_korean_unicodeScalars_Backwards 15644 15951 +2.0% 0.98x
CharIndexing_punctuatedJapanese_unicodeScalars 2966 3105 +4.7% 0.96x
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 2934 3015 +2.8% 0.97x (?)
CharIndexing_punctuated_unicodeScalars 3699 3881 +4.9% 0.95x (?)
CharIndexing_punctuated_unicodeScalars_Backwards 3709 3727 +0.5% 1.00x (?)
CharIndexing_russian_unicodeScalars 13905 14572 +4.8% 0.95x
CharIndexing_russian_unicodeScalars_Backwards 13431 13705 +2.0% 0.98x
CharIndexing_tweet_unicodeScalars_Backwards 31813 32234 +1.3% 0.99x
CharIndexing_utf16_unicodeScalars 24120 23052 -4.4% 1.05x (?)
CharIndexing_utf16_unicodeScalars_Backwards 23249 23399 +0.6% 0.99x
CharIteration_punctuatedJapanese_unicodeScalars 3658 3849 +5.2% 0.95x
CharIteration_utf16_unicodeScalars 27697 28111 +1.5% 0.99x
CharacterLiteralsLarge 5843 5831 -0.2% 1.00x (?)
CharacterLiteralsSmall 220 217 -1.4% 1.01x
CharacterPropertiesFetch 4675 4684 +0.2% 1.00x (?)
CharacterPropertiesPrecomputed 1004 1001 -0.3% 1.00x (?)
CharacterPropertiesStashed 1504 1497 -0.5% 1.00x (?)
CharacterPropertiesStashedMemo 1560 1544 -1.0% 1.01x
Chars 1020 1018 -0.2% 1.00x
ClassArrayGetter 15 15 +0.0% 1.00x
Combos 494 496 +0.4% 1.00x
DataAccessBytes 1148 1141 -0.6% 1.01x (?)
DataAppendBytes 5090 4977 -2.2% 1.02x (?)
DataAppendDataLargeToLarge 69431 67839 -2.3% 1.02x
DataAppendDataLargeToMedium 36588 35453 -3.1% 1.03x
DataAppendDataLargeToSmall 34377 34647 +0.8% 0.99x (?)
DataAppendDataMediumToLarge 38720 38418 -0.8% 1.01x (?)
DataAppendDataMediumToMedium 6970 6899 -1.0% 1.01x (?)
DataAppendDataMediumToSmall 6022 6222 +3.3% 0.97x (?)
DataAppendDataSmallToMedium 6098 6228 +2.1% 0.98x (?)
DataAppendDataSmallToSmall 6252 6186 -1.1% 1.01x (?)
DataAppendSequence 20555 20831 +1.3% 0.99x (?)
DataMutateBytes 4030 3908 -3.0% 1.03x (?)
DataReplaceLarge 37735 36610 -3.0% 1.03x (?)
DataReplaceLargeBuffer 57239 56934 -0.5% 1.01x (?)
DataReplaceMedium 7753 8003 +3.2% 0.97x (?)
DataReplaceMediumBuffer 11475 11214 -2.3% 1.02x (?)
DataReplaceSmall 5581 5569 -0.2% 1.00x (?)
DataReset 2944 2966 +0.7% 0.99x (?)
DataSubscript 220 220 +0.0% 1.00x
DictOfArraysToArrayOfDicts 783 775 -1.0% 1.01x (?)
Dictionary 509 515 +1.2% 0.99x
Dictionary2 627 629 +0.3% 1.00x (?)
Dictionary2OfObjects 2078 2076 -0.1% 1.00x (?)
Dictionary3 223 224 +0.4% 1.00x (?)
Dictionary3OfObjects 738 738 +0.0% 1.00x
Dictionary4 314 317 +1.0% 0.99x
Dictionary4Legacy 692 696 +0.6% 0.99x (?)
Dictionary4OfObjects 430 430 +0.0% 1.00x
Dictionary4OfObjectsLegacy 1006 1007 +0.1% 1.00x (?)
DictionaryBridge 1200 1189 -0.9% 1.01x (?)
DictionaryBridgeToObjC_Access 1047 998 -4.7% 1.05x (?)
DictionaryBridgeToObjC_Bridge 19 19 +0.0% 1.00x
DictionaryBridgeToObjC_BulkAccess 169 166 -1.8% 1.02x (?)
DictionaryCopy 106632 106902 +0.3% 1.00x (?)
DictionaryFilter 106188 106317 +0.1% 1.00x (?)
DictionaryGroup 218 217 -0.5% 1.00x
DictionaryGroupOfObjects 2134 2124 -0.5% 1.00x
DictionaryKeysContainsCocoa 41 41 +0.0% 1.00x
DictionaryKeysContainsNative 32 32 +0.0% 1.00x
DictionaryLiteral 1909 1905 -0.2% 1.00x (?)
DictionaryOfObjects 2376 2371 -0.2% 1.00x
DictionaryRemoveOfObjects 26195 25950 -0.9% 1.01x
DictionarySubscriptDefaultMutation 265 266 +0.4% 1.00x
DictionarySubscriptDefaultMutationArray 618 620 +0.3% 1.00x
DictionarySubscriptDefaultMutationArrayOfObjects 4031 4037 +0.1% 1.00x (?)
DictionarySubscriptDefaultMutationOfObjects 1717 1695 -1.3% 1.01x
DictionarySwap 1032 1033 +0.1% 1.00x
DictionarySwapAtOfObjects 52543 52616 +0.1% 1.00x (?)
DictionarySwapOfObjects 8717 8861 +1.7% 0.98x
DoubleWidthDivision 0 0 +0.0% 1.00x
DropFirstAnyCollection 76 76 +0.0% 1.00x
DropFirstAnySeqCRangeIter 93 93 +0.0% 1.00x
DropFirstAnySeqCRangeIterLazy 93 93 +0.0% 1.00x
DropFirstAnySeqCntRange 71 71 +0.0% 1.00x
DropFirstAnySeqCntRangeLazy 71 71 +0.0% 1.00x
DropFirstAnySequence 1842 1843 +0.1% 1.00x
DropFirstAnySequenceLazy 1842 1841 -0.1% 1.00x
DropFirstArray 35 35 +0.0% 1.00x
DropFirstArrayLazy 35 35 +0.0% 1.00x
DropFirstCountableRange 35 35 +0.0% 1.00x
DropFirstCountableRangeLazy 35 35 +0.0% 1.00x
DropFirstSequence 2681 2681 +0.0% 1.00x
DropFirstSequenceLazy 2776 2774 -0.1% 1.00x
DropLastAnyCollection 28 28 +0.0% 1.00x
DropLastAnyCollectionLazy 21653 21726 +0.3% 1.00x (?)
DropLastAnySeqCRangeIter 3309 3314 +0.2% 1.00x (?)
DropLastAnySeqCRangeIterLazy 3310 3310 +0.0% 1.00x
DropLastAnySeqCntRange 11 11 +0.0% 1.00x
DropLastAnySeqCntRangeLazy 11 11 +0.0% 1.00x
DropLastAnySequence 4969 4958 -0.2% 1.00x
DropLastAnySequenceLazy 5039 5039 +0.0% 1.00x
DropLastCountableRange 11 11 +0.0% 1.00x
DropLastSequence 673 645 -4.2% 1.04x
DropLastSequenceLazy 674 644 -4.5% 1.05x
DropWhileAnyCollection 100 100 +0.0% 1.00x
DropWhileAnyCollectionLazy 130 130 +0.0% 1.00x
DropWhileAnySeqCRangeIter 75 76 +1.3% 0.99x
DropWhileAnySeqCRangeIterLazy 130 130 +0.0% 1.00x
DropWhileAnySeqCntRange 95 95 +0.0% 1.00x
DropWhileAnySeqCntRangeLazy 130 130 +0.0% 1.00x
DropWhileAnySequence 1861 1860 -0.1% 1.00x (?)
DropWhileAnySequenceLazy 1855 1854 -0.1% 1.00x (?)
DropWhileArrayLazy 88 88 +0.0% 1.00x
DropWhileCountableRange 36 36 +0.0% 1.00x
DropWhileCountableRangeLazy 105 105 +0.0% 1.00x
DropWhileSequence 2219 2205 -0.6% 1.01x
DropWhileSequenceLazy 88 88 +0.0% 1.00x
EqualStringSubstring 49 49 +0.0% 1.00x
EqualSubstringString 49 50 +2.0% 0.98x
EqualSubstringSubstring 50 49 -2.0% 1.02x
EqualSubstringSubstringGenericEquatable 50 49 -2.0% 1.02x
ErrorHandling 1190 1189 -0.1% 1.00x (?)
ExclusivityGlobal 5 5 +0.0% 1.00x
ExclusivityIndependent 2 2 +0.0% 1.00x
FilterEvenUsingReduceInto 158 158 +0.0% 1.00x
FloatingPointPrinting_Double_description_small 21595 21450 -0.7% 1.01x (?)
FloatingPointPrinting_Double_description_uniform 21127 21016 -0.5% 1.01x (?)
FloatingPointPrinting_Double_interpolated 62190 61985 -0.3% 1.00x (?)
FloatingPointPrinting_Float80_description_small 28494 28653 +0.6% 0.99x (?)
FloatingPointPrinting_Float80_description_uniform 27627 27544 -0.3% 1.00x (?)
FloatingPointPrinting_Float80_interpolated 65382 65215 -0.3% 1.00x (?)
FloatingPointPrinting_Float_description_small 5416 5530 +2.1% 0.98x (?)
FloatingPointPrinting_Float_description_uniform 5701 5682 -0.3% 1.00x
FloatingPointPrinting_Float_interpolated 38661 38434 -0.6% 1.01x (?)
FrequenciesUsingReduceInto 1491 1487 -0.3% 1.00x (?)
Hanoi 2098 2166 +3.2% 0.97x
HashTest 944 941 -0.3% 1.00x (?)
Integrate 342 336 -1.8% 1.02x
IterateData 1490 1443 -3.2% 1.03x
Join 164 164 +0.0% 1.00x
LazilyFilteredArrayContains 36675 37471 +2.2% 0.98x
LazilyFilteredArrays 65202 65152 -0.1% 1.00x (?)
LazilyFilteredRange 3886 3854 -0.8% 1.01x
LessSubstringSubstring 48 50 +4.2% 0.96x
LessSubstringSubstringGenericComparable 48 50 +4.2% 0.96x
LinkedList 7588 7582 -0.1% 1.00x
LuhnAlgoEager 452 455 +0.7% 0.99x
LuhnAlgoLazy 447 451 +0.9% 0.99x (?)
MapReduceAnyCollectionShort 2035 2086 +2.5% 0.98x
MapReduceClass 3001 3009 +0.3% 1.00x
MapReduceClassShort 4559 4574 +0.3% 1.00x
MapReduceLazyCollection 13 13 +0.0% 1.00x
MapReduceLazySequence 86 86 +0.0% 1.00x
MapReduceSequence 471 472 +0.2% 1.00x (?)
MapReduceShort 2016 1992 -1.2% 1.01x
MapReduceShortString 20 20 +0.0% 1.00x
MapReduceString 48 48 +0.0% 1.00x
Memset 215 218 +1.4% 0.99x (?)
MonteCarloE 10303 10309 +0.1% 1.00x (?)
MonteCarloPi 42724 42945 +0.5% 0.99x (?)
NSDictionaryCastToSwift 6960 7265 +4.4% 0.96x (?)
NSError 166 165 -0.6% 1.01x (?)
NSStringConversion 686 691 +0.7% 0.99x (?)
NibbleSort 3689 3704 +0.4% 1.00x
ObjectAllocation 132 132 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObject 25442 26504 +4.2% 0.96x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 44948 45158 +0.5% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 43926 43566 -0.8% 1.01x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 112231 111282 -0.8% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObject 49552 49399 -0.3% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 64295 67649 +5.2% 0.95x
ObjectiveCBridgeFromNSString 1215 1199 -1.3% 1.01x (?)
ObjectiveCBridgeFromNSStringForced 2728 2714 -0.5% 1.01x (?)
ObjectiveCBridgeStubDataAppend 6346 6454 +1.7% 0.98x (?)
ObjectiveCBridgeStubDateMutation 400 401 +0.2% 1.00x
ObjectiveCBridgeStubFromNSDate 6555 6625 +1.1% 0.99x (?)
ObjectiveCBridgeStubFromNSString 1024 1000 -2.3% 1.02x (?)
ObjectiveCBridgeStubFromNSStringRef 158 158 +0.0% 1.00x
ObjectiveCBridgeStubNSDataAppend 2643 2616 -1.0% 1.01x (?)
ObjectiveCBridgeStubNSDateMutationRef 13285 13690 +3.0% 0.97x (?)
ObjectiveCBridgeStubToArrayOfNSString 39987 39686 -0.8% 1.01x (?)
ObjectiveCBridgeStubToNSDateRef 3481 3463 -0.5% 1.01x
ObjectiveCBridgeStubToNSString 2345 2355 +0.4% 1.00x (?)
ObjectiveCBridgeStubToNSStringRef 113 118 +4.4% 0.96x
ObjectiveCBridgeStubURLAppendPath 283359 279302 -1.4% 1.01x (?)
ObjectiveCBridgeStubURLAppendPathRef 279334 288417 +3.3% 0.97x (?)
ObjectiveCBridgeToNSSet 17886 17050 -4.7% 1.05x (?)
ObjectiveCBridgeToNSString 461 464 +0.7% 0.99x
ObserverClosure 2155 2132 -1.1% 1.01x (?)
ObserverForwarderStruct 1223 1210 -1.1% 1.01x (?)
ObserverPartiallyAppliedMethod 3692 3710 +0.5% 1.00x (?)
ObserverUnappliedMethod 2458 2455 -0.1% 1.00x (?)
OpaqueConsumingUsers 4180 4181 +0.0% 1.00x
OpenClose 63 65 +3.2% 0.97x
PartialApplyDynamicType 0 0 +0.0% 1.00x
Phonebook 6663 6622 -0.6% 1.01x
PolymorphicCalls 25 25 +0.0% 1.00x
PopFrontArray 1975 1985 +0.5% 0.99x (?)
PopFrontArrayGeneric 1972 1981 +0.5% 1.00x (?)
PopFrontUnsafePointer 9530 9110 -4.4% 1.05x
PrefixAnyCollection 76 76 +0.0% 1.00x
PrefixAnyCollectionLazy 67341 64714 -3.9% 1.04x (?)
PrefixAnySeqCRangeIter 40 40 +0.0% 1.00x
PrefixAnySeqCRangeIterLazy 40 40 +0.0% 1.00x
PrefixAnySeqCntRange 71 71 +0.0% 1.00x
PrefixAnySeqCntRangeLazy 71 71 +0.0% 1.00x
PrefixAnySequence 1378 1379 +0.1% 1.00x
PrefixAnySequenceLazy 1378 1379 +0.1% 1.00x
PrefixArray 35 35 +0.0% 1.00x
PrefixArrayLazy 35 35 +0.0% 1.00x
PrefixCountableRange 35 35 +0.0% 1.00x
PrefixCountableRangeLazy 35 35 +0.0% 1.00x
PrefixSequence 2223 2222 -0.0% 1.00x
PrefixSequenceLazy 2275 2275 +0.0% 1.00x
PrefixWhileAnyCollection 147 147 +0.0% 1.00x
PrefixWhileAnyCollectionLazy 71 71 +0.0% 1.00x
PrefixWhileAnySeqCRangeIter 385 393 +2.1% 0.98x
PrefixWhileAnySeqCRangeIterLazy 89 89 +0.0% 1.00x
PrefixWhileAnySeqCntRange 142 142 +0.0% 1.00x
PrefixWhileAnySeqCntRangeLazy 71 71 +0.0% 1.00x
PrefixWhileAnySequence 1539 1542 +0.2% 1.00x
PrefixWhileAnySequenceLazy 1391 1391 +0.0% 1.00x
PrefixWhileArray 88 88 +0.0% 1.00x
PrefixWhileArrayLazy 70 70 +0.0% 1.00x
PrefixWhileCountableRange 36 36 +0.0% 1.00x
PrefixWhileCountableRangeLazy 35 35 +0.0% 1.00x
PrefixWhileSequence 362 362 +0.0% 1.00x
PrefixWhileSequenceLazy 52 52 +0.0% 1.00x
Prims 932 920 -1.3% 1.01x (?)
PrimsSplit 918 919 +0.1% 1.00x (?)
QueueConcrete 1150 1150 +0.0% 1.00x
QueueGeneric 1136 1137 +0.1% 1.00x
RGBHistogram 2971 2994 +0.8% 0.99x (?)
RGBHistogramOfObjects 23638 23668 +0.1% 1.00x (?)
Radix2CooleyTukey 12672 12477 -1.5% 1.02x (?)
Radix2CooleyTukeyf 8914 8959 +0.5% 0.99x (?)
RandomDoubleDef 26615 26559 -0.2% 1.00x
RandomIntegersDef 24310 24469 +0.7% 0.99x (?)
RandomIntegersLCG 173 173 +0.0% 1.00x
RandomShuffleDef 812675 810718 -0.2% 1.00x
RandomShuffleLCG 56332 57314 +1.7% 0.98x
RangeAssignment 349 337 -3.4% 1.04x
RangeReplaceableCollectionPlusDefault 1064 1056 -0.8% 1.01x (?)
RecursiveOwnedParameter 115 115 +0.0% 1.00x
RemoveWhereFilterInts 47 47 +0.0% 1.00x
RemoveWhereFilterString 245 244 -0.4% 1.00x
RemoveWhereFilterStrings 441 438 -0.7% 1.01x
RemoveWhereMoveStrings 710 709 -0.1% 1.00x (?)
RemoveWhereQuadraticInts 1293 1293 +0.0% 1.00x
RemoveWhereQuadraticString 370 370 +0.0% 1.00x
RemoveWhereQuadraticStrings 2762 2759 -0.1% 1.00x (?)
RemoveWhereSwapInts 19 19 +0.0% 1.00x
RemoveWhereSwapStrings 859 859 +0.0% 1.00x
ReversedArray 57 57 +0.0% 1.00x
ReversedBidirectional 16912 16853 -0.3% 1.00x (?)
ReversedDictionary 265 266 +0.4% 1.00x (?)
RomanNumbers 83971 82540 -1.7% 1.02x
SequenceAlgosAnySequence 11920 11922 +0.0% 1.00x (?)
SequenceAlgosArray 1579 1564 -0.9% 1.01x (?)
SequenceAlgosContiguousArray 1565 1577 +0.8% 0.99x (?)
SequenceAlgosList 1353 1354 +0.1% 1.00x (?)
SequenceAlgosRange 2577 2577 +0.0% 1.00x
SequenceAlgosUnfoldSequence 1102 1102 +0.0% 1.00x
SetExclusiveOr 5124 5146 +0.4% 1.00x (?)
SetExclusiveOr_OfObjects 11605 11610 +0.0% 1.00x (?)
SetIntersect 701 696 -0.7% 1.01x (?)
SetIntersect_OfObjects 1774 1830 +3.2% 0.97x
SetIsSubsetOf 345 345 +0.0% 1.00x
SetIsSubsetOf_OfObjects 441 440 -0.2% 1.00x
SetUnion 4459 4383 -1.7% 1.02x
SetUnion_OfObjects 10090 10023 -0.7% 1.01x
SevenBoom 844 840 -0.5% 1.00x (?)
SortLargeExistentials 5506 5536 +0.5% 0.99x
SortLettersInPlace 1001 992 -0.9% 1.01x (?)
SortSortedStrings 849 855 +0.7% 0.99x
SortStrings 1766 1773 +0.4% 1.00x (?)
SortStringsUnicode 2498 2544 +1.8% 0.98x
StackPromo 25177 24990 -0.7% 1.01x (?)
StrComplexWalk 1781 1775 -0.3% 1.00x
StrToInt 3170 3156 -0.4% 1.00x
StringAdder 528 523 -0.9% 1.01x
StringBuilder 439 435 -0.9% 1.01x
StringBuilderLong 1276 1334 +4.5% 0.96x (?)
StringBuilderSmallReservingCapacity 454 448 -1.3% 1.01x
StringComparison_abnormal 764 762 -0.3% 1.00x (?)
StringComparison_ascii 1014 1020 +0.6% 0.99x (?)
StringComparison_emoji 866 870 +0.5% 1.00x (?)
StringComparison_fastPrenormal 834 841 +0.8% 0.99x
StringComparison_latin1 650 654 +0.6% 0.99x
StringComparison_longSharedPrefix 954 961 +0.7% 0.99x
StringComparison_nonBMPSlowestPrenormal 1698 1683 -0.9% 1.01x
StringComparison_slowerPrenormal 1824 1843 +1.0% 0.99x
StringComparison_zalgo 110815 111059 +0.2% 1.00x (?)
StringEdits 169944 177604 +4.5% 0.96x (?)
StringEnumRawValueInitialization 901 869 -3.6% 1.04x
StringFromLongWholeSubstring 21 21 +0.0% 1.00x
StringFromLongWholeSubstringGeneric 21 21 +0.0% 1.00x
StringHasPrefixAscii 2205 2204 -0.0% 1.00x (?)
StringHasPrefixUnicode 101325 101898 +0.6% 0.99x (?)
StringHasSuffixAscii 2261 2234 -1.2% 1.01x
StringHasSuffixUnicode 100254 100286 +0.0% 1.00x (?)
StringHashing_abnormal 1342 1340 -0.1% 1.00x (?)
StringHashing_ascii 33 33 +0.0% 1.00x
StringHashing_emoji 1903 1902 -0.1% 1.00x (?)
StringHashing_fastPrenormal 8444 8439 -0.1% 1.00x (?)
StringHashing_latin1 2590 2594 +0.2% 1.00x (?)
StringHashing_longSharedPrefix 8031 8035 +0.0% 1.00x (?)
StringHashing_nonBMPSlowestPrenormal 2053 2078 +1.2% 0.99x (?)
StringHashing_slowerPrenormal 2756 2765 +0.3% 1.00x (?)
StringHashing_zalgo 3485 3471 -0.4% 1.00x (?)
StringInterpolation 9206 9126 -0.9% 1.01x (?)
StringInterpolationManySmallSegments 18802 18303 -2.7% 1.03x
StringInterpolationSmall 4207 4182 -0.6% 1.01x
StringMatch 11963 12049 +0.7% 0.99x
StringRemoveDupes 474 475 +0.2% 1.00x (?)
StringUTF16Builder 2634 2602 -1.2% 1.01x
StringUTF16SubstringBuilder 5944 6193 +4.2% 0.96x (?)
StringWalk 1544 1555 +0.7% 0.99x
StringWithCString 46393 46394 +0.0% 1.00x (?)
StringWordBuilder 2336 2276 -2.6% 1.03x
StringWordBuilderReservingCapacity 1940 1926 -0.7% 1.01x (?)
SubstringComparable 13 13 +0.0% 1.00x
SubstringEqualString 615 614 -0.2% 1.00x (?)
SubstringEquatable 1428 1421 -0.5% 1.00x
SubstringFromLongString 10 10 +0.0% 1.00x
SubstringFromLongStringGeneric 74 74 +0.0% 1.00x
SuffixAnyCollection 28 28 +0.0% 1.00x
SuffixAnyCollectionLazy 21834 21790 -0.2% 1.00x (?)
SuffixAnySeqCRangeIter 3594 3599 +0.1% 1.00x (?)
SuffixAnySeqCRangeIterLazy 3602 3588 -0.4% 1.00x (?)
SuffixAnySeqCntRange 17 17 +0.0% 1.00x
SuffixAnySeqCntRangeLazy 17 17 +0.0% 1.00x
SuffixAnySequence 4905 4913 +0.2% 1.00x
SuffixAnySequenceLazy 5022 4995 -0.5% 1.01x
SuffixSequence 3655 3610 -1.2% 1.01x
SuffixSequenceLazy 3658 3607 -1.4% 1.01x
SumUsingReduceInto 97 102 +5.2% 0.95x
SuperChars 20096 20101 +0.0% 1.00x (?)
TwoSum 1470 1438 -2.2% 1.02x
TypeFlood 0 0 +0.0% 1.00x
UTF8Decode_InitDecoding 1346 1346 +0.0% 1.00x
UTF8Decode_InitDecoding_ascii 655 653 -0.3% 1.00x (?)
UTF8Decode_InitFromBytes 1190 1187 -0.3% 1.00x (?)
UTF8Decode_InitFromData 1258 1250 -0.6% 1.01x (?)
UTF8Decode_InitFromData_ascii 794 820 +3.3% 0.97x (?)
Walsh 443 432 -2.5% 1.03x
WordCountHistogramASCII 7966 8085 +1.5% 0.99x
WordCountHistogramUTF16 11226 11271 +0.4% 1.00x
WordCountUniqueASCII 2070 2078 +0.4% 1.00x
WordCountUniqueUTF16 4594 4599 +0.1% 1.00x (?)
WordSplitASCII 9031 9114 +0.9% 0.99x (?)
WordSplitUTF16 10546 10465 -0.8% 1.01x (?)
XorLoop 403 398 -1.2% 1.01x (?)
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

@eeckstein eeckstein merged commit 31b511e into swiftlang:master Jul 12, 2018
@eeckstein eeckstein deleted the fix-compactmap-perf branch July 12, 2018 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants