Skip to content

Some performance improvements in the stdlib, mainly for small string literals #16890

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 6 commits into from
May 30, 2018

Conversation

eeckstein
Copy link
Contributor

For details see the commit list

eeckstein added 6 commits May 29, 2018 11:01
…ull-terminated C string.

And remove the now unused _SentinelCollection utility.
We can always eliminate ARC operations on the result of a value_to_bridge_object instruction.
There is no need to restrict the operand to a specific SIL pattern.
…nd pointers to start-pointer + count.

This saves a few instructions for some operations, like getting the count.
Also, it avoids the check for unwrapping the optional end pointer. For example, iterating over an unsafe buffer now has no overhead.

Also remove the _unboundedStartingAt initializer, which is not needed anymore.
Making sure that makeIterator is always inlined, enables devirutalization of the iterator calls.
Inlining was not done with -Osize which resulted in pretty bad performance when iterating over an existential collection.
…o 2 constant loads.

The main part of this is to rewrite the small string literal-constructor to work with values (= shifting bytes) instead of setting bytes in memory.
This allows the compiler to fold away everything and end up with the optimal code for small string literals.
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci smoke benchmark

@eeckstein
Copy link
Contributor Author

@swift-ci test compiler performance

@eeckstein eeckstein requested a review from milseman May 29, 2018 18:29
@swift-ci
Copy link
Contributor

Build comment file:

Build failed before running benchmark.


@shahmishal
Copy link
Member

@swift-ci smoke benchmark

Copy link
Member

@milseman milseman left a comment

Choose a reason for hiding this comment

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

Just reviewing the small string changes for now.

CC @atrick for the UBP stuff

}
_sanityCheck(self.count == 0, "overwrote count early?")
self.count = count
high |= (UInt(count) &<< (8*15))
Copy link
Member

Choose a reason for hiding this comment

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

Can you instead put this in the setter for count, so that all other code paths can benefit?

Also, rather than have a naked 15, you can use capacity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, the count setter would have to mask out the old value, which is not needed here.
Also, I followed the count getter+setter pattern which also hard-code the '15'.

self.count = count
high |= (UInt(count) &<< (8*15))
let low = _bytesToUInt(addr, lowCount)
_storage = (low, high)
Copy link
Member

Choose a reason for hiding this comment

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

I think the code would be more clear if this was in the if-else blocks. We'd also not need to introduce so many in-scope variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to reduce the number of calls to _bytesToUInt. Although llvm can fold away the whole loop, this is not yet done on SIL level, so duplicating _bytes_ToUInt in the then- and else-branch generates an additional loop in SIL.

shift = shift &+ 8
}
return r
}
Copy link
Member

@milseman milseman May 29, 2018

Choose a reason for hiding this comment

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

Isn't this whole function just a (potentially-unaligned) load and bitfield-insert mask? Can you verify what code is generated here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The whole code is folded away (that's the point of the change). I added a test for that: SILOptimizer/string_literals.swift

Copy link
Member

@milseman milseman May 29, 2018

Choose a reason for hiding this comment

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

(following up), this code is also called for many other dynamic String initializations, so we'd want efficient code even when it can't be constant folded.

Copy link
Contributor

Choose a reason for hiding this comment

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

Erik and I discussed changing the UBP representation. I couldn't think of any good reason to keep the (start, end] representation for the buffer, as long as the iterator keeps its representation.

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (39)
TEST OLD NEW DELTA SPEEDUP
ObjectiveCBridgeFromNSArrayAnyObjectForced 4764 5927 +24.4% 0.80x
SequenceAlgosAnySequence 11983 14833 +23.8% 0.81x
DropFirstAnySeqCRangeIterLazy 21416 26491 +23.7% 0.81x
DropFirstAnySeqCRangeIter 21453 26422 +23.2% 0.81x
StaticArray 9 11 +22.2% 0.82x
PrefixAnySeqCRangeIter 16650 20268 +21.7% 0.82x
PrefixAnySeqCRangeIterLazy 16662 20273 +21.7% 0.82x
DropWhileAnySeqCRangeIter 17254 20456 +18.6% 0.84x
RangeIterationSigned 171 200 +17.0% 0.86x
ObjectiveCBridgeStubFromArrayOfNSString 34818 40409 +16.1% 0.86x (?)
NopDeinit 30169 34865 +15.6% 0.87x
ObjectiveCBridgeStubFromNSDate 6141 7025 +14.4% 0.87x (?)
COWArrayGuaranteedParameterOverhead 8606 9830 +14.2% 0.88x (?)
SuffixAnyCollectionLazy 21150 23428 +10.8% 0.90x
DataReplaceMediumBuffer 14857 16390 +10.3% 0.91x (?)
DropFirstAnyCollectionLazy 63345 69866 +10.3% 0.91x
RandomIntegersLCG 2090 2294 +9.8% 0.91x
PrefixAnyCollectionLazy 63153 68943 +9.2% 0.92x
SuffixCountableRangeLazy 11 12 +9.1% 0.92x
DropLastCountableRangeLazy 11 12 +9.1% 0.92x
ObjectiveCBridgeFromNSArrayAnyObject 25604 27591 +7.8% 0.93x (?)
DropLastAnySeqCntRangeLazy 13 14 +7.7% 0.93x
DropLastAnyCollectionLazy 21254 22822 +7.4% 0.93x (?)
FloatingPointPrinting_Float_interpolated 41892 44980 +7.4% 0.93x (?)
RemoveWhereMoveInts 14 15 +7.1% 0.93x
DictionarySubscriptDefaultMutation 272 291 +7.0% 0.93x
DataReplaceMedium 12423 13277 +6.9% 0.94x (?)
DataAppendDataSmallToSmall 6661 7100 +6.6% 0.94x (?)
DictionaryBridge 1159 1234 +6.5% 0.94x
AngryPhonebook 3867 4113 +6.4% 0.94x (?)
StringEqualPointerComparison 286 304 +6.3% 0.94x
DropLastSequence 628 667 +6.2% 0.94x
StringUTF16SubstringBuilder 5841 6187 +5.9% 0.94x (?)
RemoveWhereFilterString 238 252 +5.9% 0.94x
PrimsSplit 911 963 +5.7% 0.95x
CStringLongNonAscii 2351 2485 +5.7% 0.95x
ArrayAppendUTF16 39943 42185 +5.6% 0.95x
DataAppendArray 5979 6300 +5.4% 0.95x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 64332 67759 +5.3% 0.95x (?)
Improvement (26)
TEST OLD NEW DELTA SPEEDUP
OpenClose 235 65 -72.3% 3.62x
Calculator 581 316 -45.6% 1.84x
StringInterpolationSmall 5999 4234 -29.4% 1.42x
StringAdder 806 573 -28.9% 1.41x
StringBuilder 739 549 -25.7% 1.35x
StringBuilderSmallReservingCapacity 759 568 -25.2% 1.34x
ErrorHandling 1447 1189 -17.8% 1.22x
SubstringComparable 15 13 -13.3% 1.15x
StringWordBuilder 2514 2256 -10.3% 1.11x
StringInterpolationManySmallSegments 20990 18923 -9.8% 1.11x
MapReduceShortString 23 21 -8.7% 1.10x
ArrayAppendAscii 4171 3812 -8.6% 1.09x
SuffixCountableRange 12 11 -8.3% 1.09x
PointerArithmetics 34352 31522 -8.2% 1.09x
HashTest 1049 965 -8.0% 1.09x
MapReduceAnyCollection 430 401 -6.7% 1.07x
RandomIntegersDef 27329 25518 -6.6% 1.07x
EqualSubstringString 52 49 -5.8% 1.06x
NSDictionaryCastToSwift 7196 6793 -5.6% 1.06x (?)
DataSubscript 251 237 -5.6% 1.06x
DataReplaceSmall 9766 9230 -5.5% 1.06x (?)
Hanoi 2204 2088 -5.3% 1.06x
RemoveWhereSwapInts 20 19 -5.0% 1.05x
Dictionary2 670 637 -4.9% 1.05x
SumUsingReduceInto 102 97 -4.9% 1.05x
CharIteration_ascii_unicodeScalars 22563 21462 -4.9% 1.05x
No Changes (373)
TEST OLD NEW DELTA SPEEDUP
AnyHashableWithAClass 87437 87425 -0.0% 1.00x (?)
Array2D 2854 2859 +0.2% 1.00x (?)
ArrayAppend 1075 1077 +0.2% 1.00x (?)
ArrayAppendArrayOfInt 796 778 -2.3% 1.02x (?)
ArrayAppendAsciiSubstring 24311 24202 -0.4% 1.00x
ArrayAppendFromGeneric 798 797 -0.1% 1.00x (?)
ArrayAppendGenericStructs 1431 1428 -0.2% 1.00x
ArrayAppendLatin1 40850 42214 +3.3% 0.97x
ArrayAppendLatin1Substring 140596 142421 +1.3% 0.99x
ArrayAppendLazyMap 1341 1349 +0.6% 0.99x (?)
ArrayAppendOptionals 1432 1430 -0.1% 1.00x (?)
ArrayAppendRepeatCol 1339 1339 +0.0% 1.00x
ArrayAppendReserved 810 808 -0.2% 1.00x
ArrayAppendSequence 1119 1121 +0.2% 1.00x
ArrayAppendStrings 6332 6216 -1.8% 1.02x
ArrayAppendToFromGeneric 799 797 -0.3% 1.00x (?)
ArrayAppendToGeneric 799 798 -0.1% 1.00x
ArrayAppendUTF16Substring 137308 140323 +2.2% 0.98x
ArrayInClass 86 86 +0.0% 1.00x
ArrayLiteral 0 0 +0.0% 1.00x
ArrayOfGenericPOD2 151 151 +0.0% 1.00x
ArrayOfGenericRef 4385 4392 +0.2% 1.00x
ArrayOfPOD 184 184 +0.0% 1.00x
ArrayOfRef 4355 4372 +0.4% 1.00x (?)
ArrayPlusEqualArrayOfInt 797 796 -0.1% 1.00x (?)
ArrayPlusEqualFiveElementCollection 5522 5561 +0.7% 0.99x
ArrayPlusEqualSingleElementCollection 1078 1077 -0.1% 1.00x (?)
ArrayPlusEqualThreeElements 1663 1663 +0.0% 1.00x
ArraySubscript 1557 1533 -1.5% 1.02x (?)
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
BinaryFloatingPointPropertiesBinade 31 31 +0.0% 1.00x
BinaryFloatingPointPropertiesNextUp 28 28 +0.0% 1.00x
BinaryFloatingPointPropertiesUlp 37 37 +0.0% 1.00x
BitCount 202 211 +4.5% 0.96x
ByteSwap 104 105 +1.0% 0.99x (?)
COWTree 5398 5255 -2.6% 1.03x (?)
CSVParsing 660909 657676 -0.5% 1.00x (?)
CSVParsingAlt 786270 802001 +2.0% 0.98x
CSVParsingAltIndices 338152 338359 +0.1% 1.00x (?)
CStringLongAscii 4369 4220 -3.4% 1.04x
CStringShortAscii 3367 3325 -1.2% 1.01x (?)
CaptureProp 4085 4122 +0.9% 0.99x
ChainedFilterMap 1248 1249 +0.1% 1.00x
CharIndexing_ascii_unicodeScalars 16992 17241 +1.5% 0.99x
CharIndexing_ascii_unicodeScalars_Backwards 16017 16738 +4.5% 0.96x
CharIndexing_chinese_unicodeScalars 12865 13071 +1.6% 0.98x
CharIndexing_chinese_unicodeScalars_Backwards 12135 12600 +3.8% 0.96x
CharIndexing_japanese_unicodeScalars 20386 20585 +1.0% 0.99x
CharIndexing_japanese_unicodeScalars_Backwards 19186 19940 +3.9% 0.96x
CharIndexing_korean_unicodeScalars 16498 16693 +1.2% 0.99x
CharIndexing_korean_unicodeScalars_Backwards 15543 16127 +3.8% 0.96x
CharIndexing_punctuatedJapanese_unicodeScalars 3069 3216 +4.8% 0.95x
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 2911 3004 +3.2% 0.97x
CharIndexing_punctuated_unicodeScalars 3850 3892 +1.1% 0.99x
CharIndexing_punctuated_unicodeScalars_Backwards 3641 3769 +3.5% 0.97x
CharIndexing_russian_unicodeScalars 14135 14357 +1.6% 0.98x
CharIndexing_russian_unicodeScalars_Backwards 13347 13850 +3.8% 0.96x
CharIndexing_tweet_unicodeScalars 32830 33229 +1.2% 0.99x
CharIndexing_tweet_unicodeScalars_Backwards 31223 32413 +3.8% 0.96x
CharIndexing_utf16_unicodeScalars 23760 23060 -2.9% 1.03x
CharIndexing_utf16_unicodeScalars_Backwards 24400 23426 -4.0% 1.04x
CharIteration_ascii_unicodeScalars_Backwards 15160 15208 +0.3% 1.00x
CharIteration_chinese_unicodeScalars 16611 16229 -2.3% 1.02x
CharIteration_chinese_unicodeScalars_Backwards 11489 11516 +0.2% 1.00x (?)
CharIteration_japanese_unicodeScalars 26245 25743 -1.9% 1.02x
CharIteration_japanese_unicodeScalars_Backwards 18159 18200 +0.2% 1.00x
CharIteration_korean_unicodeScalars 21218 20791 -2.0% 1.02x
CharIteration_korean_unicodeScalars_Backwards 14701 14743 +0.3% 1.00x
CharIteration_punctuatedJapanese_unicodeScalars 3897 3828 -1.8% 1.02x
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 2751 2761 +0.4% 1.00x
CharIteration_punctuated_unicodeScalars 4900 4809 -1.9% 1.02x
CharIteration_punctuated_unicodeScalars_Backwards 3442 3452 +0.3% 1.00x
CharIteration_russian_unicodeScalars 18225 17858 -2.0% 1.02x
CharIteration_russian_unicodeScalars_Backwards 12642 12678 +0.3% 1.00x (?)
CharIteration_tweet_unicodeScalars 42636 42498 -0.3% 1.00x
CharIteration_tweet_unicodeScalars_Backwards 30036 30120 +0.3% 1.00x
CharIteration_utf16_unicodeScalars 28373 27960 -1.5% 1.01x
CharIteration_utf16_unicodeScalars_Backwards 18432 18764 +1.8% 0.98x
CharacterLiteralsLarge 5940 5937 -0.1% 1.00x (?)
CharacterLiteralsSmall 217 217 +0.0% 1.00x
CharacterPropertiesFetch 4518 4544 +0.6% 0.99x (?)
CharacterPropertiesPrecomputed 1109 1107 -0.2% 1.00x (?)
CharacterPropertiesStashed 1465 1510 +3.1% 0.97x
CharacterPropertiesStashedMemo 1572 1574 +0.1% 1.00x (?)
Chars 1211 1217 +0.5% 1.00x
ClassArrayGetter 15 15 +0.0% 1.00x
Combos 489 490 +0.2% 1.00x (?)
DataAccessBytes 1142 1151 +0.8% 0.99x
DataAppendBytes 5801 6006 +3.5% 0.97x
DataAppendDataLargeToLarge 69875 69574 -0.4% 1.00x (?)
DataAppendDataLargeToMedium 36239 37380 +3.1% 0.97x (?)
DataAppendDataLargeToSmall 35645 36075 +1.2% 0.99x (?)
DataAppendDataMediumToLarge 39649 39072 -1.5% 1.01x (?)
DataAppendDataMediumToMedium 7784 7982 +2.5% 0.98x (?)
DataAppendDataMediumToSmall 7197 7249 +0.7% 0.99x (?)
DataAppendDataSmallToLarge 38462 38551 +0.2% 1.00x (?)
DataAppendDataSmallToMedium 7269 7536 +3.7% 0.96x (?)
DataAppendSequence 20541 20812 +1.3% 0.99x (?)
DataCopyBytes 2543 2553 +0.4% 1.00x (?)
DataCount 37 38 +2.7% 0.97x
DataMutateBytes 4315 4294 -0.5% 1.00x (?)
DataReplaceLarge 42167 43452 +3.0% 0.97x (?)
DataReplaceLargeBuffer 62293 62024 -0.4% 1.00x (?)
DataReplaceSmallBuffer 14152 13767 -2.7% 1.03x (?)
DataReset 3195 3207 +0.4% 1.00x (?)
DataSetCount 900 881 -2.1% 1.02x
DictOfArraysToArrayOfDicts 810 805 -0.6% 1.01x (?)
Dictionary 513 519 +1.2% 0.99x
Dictionary2OfObjects 2101 2092 -0.4% 1.00x
Dictionary3 231 234 +1.3% 0.99x
Dictionary3OfObjects 745 732 -1.7% 1.02x
Dictionary4 344 344 +0.0% 1.00x
Dictionary4Legacy 731 726 -0.7% 1.01x
Dictionary4OfObjects 461 456 -1.1% 1.01x
Dictionary4OfObjectsLegacy 947 937 -1.1% 1.01x
DictionaryCopy 107515 108497 +0.9% 0.99x
DictionaryFilter 107271 106600 -0.6% 1.01x (?)
DictionaryGroup 219 216 -1.4% 1.01x
DictionaryGroupOfObjects 2123 2140 +0.8% 0.99x (?)
DictionaryKeysContainsCocoa 38 39 +2.6% 0.97x (?)
DictionaryKeysContainsNative 31 32 +3.2% 0.97x (?)
DictionaryLiteral 1923 1915 -0.4% 1.00x (?)
DictionaryOfObjects 2392 2380 -0.5% 1.01x
DictionaryRemove 4245 4218 -0.6% 1.01x
DictionaryRemoveOfObjects 26005 26110 +0.4% 1.00x (?)
DictionarySubscriptDefaultMutationArray 619 620 +0.2% 1.00x (?)
DictionarySubscriptDefaultMutationArrayOfObjects 4025 4023 -0.0% 1.00x (?)
DictionarySubscriptDefaultMutationOfObjects 1732 1721 -0.6% 1.01x (?)
DictionarySwap 1042 1089 +4.5% 0.96x (?)
DictionarySwapAt 7155 6868 -4.0% 1.04x
DictionarySwapAtOfObjects 52495 52417 -0.1% 1.00x (?)
DictionarySwapOfObjects 8905 8950 +0.5% 0.99x (?)
DoubleWidthDivision 0 0 +0.0% 1.00x
DropFirstAnyCollection 84 84 +0.0% 1.00x
DropFirstAnySeqCntRange 41 41 +0.0% 1.00x
DropFirstAnySeqCntRangeLazy 41 41 +0.0% 1.00x
DropFirstAnySequence 5067 5117 +1.0% 0.99x
DropFirstAnySequenceLazy 5061 5115 +1.1% 0.99x
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 2683 +0.1% 1.00x (?)
DropFirstSequenceLazy 2778 2775 -0.1% 1.00x
DropLastAnyCollection 30 31 +3.3% 0.97x (?)
DropLastAnySeqCRangeIter 3540 3535 -0.1% 1.00x (?)
DropLastAnySeqCRangeIterLazy 3538 3539 +0.0% 1.00x (?)
DropLastAnySeqCntRange 13 13 +0.0% 1.00x
DropLastAnySequence 4956 4975 +0.4% 1.00x
DropLastAnySequenceLazy 5050 5066 +0.3% 1.00x
DropLastCountableRange 11 11 +0.0% 1.00x
DropLastSequenceLazy 634 666 +5.0% 0.95x
DropWhileAnyCollection 107 107 +0.0% 1.00x
DropWhileAnyCollectionLazy 125 125 +0.0% 1.00x
DropWhileAnySeqCRangeIterLazy 125 125 +0.0% 1.00x
DropWhileAnySeqCntRange 51 51 +0.0% 1.00x
DropWhileAnySeqCntRangeLazy 125 125 +0.0% 1.00x
DropWhileAnySequence 4835 4832 -0.1% 1.00x
DropWhileAnySequenceLazy 1857 1856 -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 2223 2224 +0.0% 1.00x (?)
DropWhileSequenceLazy 88 88 +0.0% 1.00x
EqualStringSubstring 51 49 -3.9% 1.04x
EqualSubstringSubstring 48 49 +2.1% 0.98x
EqualSubstringSubstringGenericEquatable 48 49 +2.1% 0.98x
ExclusivityGlobal 5 5 +0.0% 1.00x
ExclusivityIndependent 2 2 +0.0% 1.00x
FatCompactMap 199634 199408 -0.1% 1.00x
FilterEvenUsingReduce 1318 1315 -0.2% 1.00x (?)
FilterEvenUsingReduceInto 148 150 +1.4% 0.99x
FloatingPointPrinting_Double_description_small 23666 23680 +0.1% 1.00x (?)
FloatingPointPrinting_Double_description_uniform 23228 23086 -0.6% 1.01x (?)
FloatingPointPrinting_Double_interpolated 67990 64911 -4.5% 1.05x (?)
FloatingPointPrinting_Float80_description_small 30508 30466 -0.1% 1.00x (?)
FloatingPointPrinting_Float80_description_uniform 29635 29986 +1.2% 0.99x
FloatingPointPrinting_Float80_interpolated 71781 70269 -2.1% 1.02x (?)
FloatingPointPrinting_Float_description_small 5465 5682 +4.0% 0.96x
FloatingPointPrinting_Float_description_uniform 5287 5507 +4.2% 0.96x
FrequenciesUsingReduce 5058 5115 +1.1% 0.99x
FrequenciesUsingReduceInto 1599 1560 -2.4% 1.02x
Histogram 705 694 -1.6% 1.02x
Integrate 342 334 -2.3% 1.02x
IterateData 1497 1540 +2.9% 0.97x
Join 163 169 +3.7% 0.96x
LazilyFilteredArrayContains 36695 35488 -3.3% 1.03x
LazilyFilteredArrays 64306 64872 +0.9% 0.99x (?)
LazilyFilteredRange 3880 3876 -0.1% 1.00x (?)
LessSubstringSubstring 48 49 +2.1% 0.98x
LessSubstringSubstringGenericComparable 48 49 +2.1% 0.98x
LinkedList 7587 7582 -0.1% 1.00x (?)
LuhnAlgoEager 449 441 -1.8% 1.02x (?)
LuhnAlgoLazy 450 448 -0.4% 1.00x (?)
MapReduce 371 371 +0.0% 1.00x
MapReduceAnyCollectionShort 2278 2266 -0.5% 1.01x
MapReduceClass 2997 3013 +0.5% 0.99x
MapReduceClassShort 4628 4580 -1.0% 1.01x
MapReduceLazyCollection 13 13 +0.0% 1.00x
MapReduceLazyCollectionShort 37 37 +0.0% 1.00x
MapReduceLazySequence 86 86 +0.0% 1.00x
MapReduceSequence 450 452 +0.4% 1.00x (?)
MapReduceShort 2001 2024 +1.1% 0.99x (?)
MapReduceString 49 48 -2.0% 1.02x
Memset 215 216 +0.5% 1.00x (?)
MonteCarloE 10334 10176 -1.5% 1.02x
MonteCarloPi 42797 42644 -0.4% 1.00x
NSError 172 170 -1.2% 1.01x (?)
NSStringConversion 727 697 -4.1% 1.04x
NibbleSort 3672 3699 +0.7% 0.99x
ObjectAllocation 133 133 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObjectToString 47004 45369 -3.5% 1.04x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 45490 46425 +2.1% 0.98x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 113629 119044 +4.8% 0.95x (?)
ObjectiveCBridgeFromNSSetAnyObject 51374 51117 -0.5% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 5107 4891 -4.2% 1.04x (?)
ObjectiveCBridgeFromNSString 1215 1189 -2.1% 1.02x
ObjectiveCBridgeFromNSStringForced 2827 2704 -4.4% 1.05x (?)
ObjectiveCBridgeStubDataAppend 11351 11761 +3.6% 0.97x
ObjectiveCBridgeStubDateMutation 401 400 -0.2% 1.00x
ObjectiveCBridgeStubFromNSString 1031 1051 +1.9% 0.98x (?)
ObjectiveCBridgeStubFromNSStringRef 167 167 +0.0% 1.00x
ObjectiveCBridgeStubNSDataAppend 2539 2596 +2.2% 0.98x (?)
ObjectiveCBridgeStubNSDateMutationRef 13703 13759 +0.4% 1.00x (?)
ObjectiveCBridgeStubToArrayOfNSString 38577 39619 +2.7% 0.97x (?)
ObjectiveCBridgeStubToNSDate 14767 15060 +2.0% 0.98x (?)
ObjectiveCBridgeStubToNSDateRef 3374 3418 +1.3% 0.99x (?)
ObjectiveCBridgeStubToNSString 2391 2390 -0.0% 1.00x (?)
ObjectiveCBridgeStubToNSStringRef 121 124 +2.5% 0.98x
ObjectiveCBridgeStubURLAppendPath 288163 294109 +2.1% 0.98x (?)
ObjectiveCBridgeStubURLAppendPathRef 296693 297271 +0.2% 1.00x (?)
ObjectiveCBridgeToNSArray 14882 14598 -1.9% 1.02x (?)
ObjectiveCBridgeToNSDictionary 25990 26345 +1.4% 0.99x (?)
ObjectiveCBridgeToNSSet 16929 17220 +1.7% 0.98x (?)
ObjectiveCBridgeToNSString 490 481 -1.8% 1.02x
ObserverClosure 2203 2159 -2.0% 1.02x
ObserverForwarderStruct 1257 1261 +0.3% 1.00x (?)
ObserverPartiallyAppliedMethod 3778 3737 -1.1% 1.01x
ObserverUnappliedMethod 2530 2527 -0.1% 1.00x (?)
OpaqueConsumingUsers 4183 4180 -0.1% 1.00x
PartialApplyDynamicType 0 0 +0.0% 1.00x
Phonebook 6794 6798 +0.1% 1.00x (?)
PolymorphicCalls 25 25 +0.0% 1.00x
PopFrontArray 1976 2001 +1.3% 0.99x (?)
PopFrontArrayGeneric 1977 1993 +0.8% 0.99x (?)
PopFrontUnsafePointer 9145 9517 +4.1% 0.96x (?)
PrefixAnyCollection 83 84 +1.2% 0.99x
PrefixAnySeqCntRange 28 28 +0.0% 1.00x
PrefixAnySeqCntRangeLazy 28 28 +0.0% 1.00x
PrefixAnySequence 4338 4341 +0.1% 1.00x (?)
PrefixAnySequenceLazy 4331 4344 +0.3% 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 2225 2222 -0.1% 1.00x
PrefixSequenceLazy 2278 2277 -0.0% 1.00x
PrefixWhileAnyCollection 154 154 +0.0% 1.00x
PrefixWhileAnyCollectionLazy 90 90 +0.0% 1.00x
PrefixWhileAnySeqCRangeIter 8689 8692 +0.0% 1.00x (?)
PrefixWhileAnySeqCRangeIterLazy 72 72 +0.0% 1.00x
PrefixWhileAnySeqCntRange 60 60 +0.0% 1.00x
PrefixWhileAnySeqCntRangeLazy 90 90 +0.0% 1.00x
PrefixWhileAnySequence 9908 9960 +0.5% 0.99x
PrefixWhileAnySequenceLazy 1394 1393 -0.1% 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 360 361 +0.3% 1.00x
PrefixWhileSequenceLazy 52 52 +0.0% 1.00x
Prims 907 902 -0.6% 1.01x (?)
QueueConcrete 1147 1149 +0.2% 1.00x (?)
QueueGeneric 1147 1147 +0.0% 1.00x
RC4 160 168 +5.0% 0.95x
RGBHistogram 3218 3323 +3.3% 0.97x
RGBHistogramOfObjects 23734 23919 +0.8% 0.99x (?)
RandomDoubleDef 28904 27761 -4.0% 1.04x
RandomDoubleLCG 4186 4405 +5.2% 0.95x
RandomShuffleDef 832739 847093 +1.7% 0.98x
RandomShuffleLCG 150360 156576 +4.1% 0.96x (?)
RangeAssignment 335 338 +0.9% 0.99x
RangeReplaceableCollectionPlusDefault 1029 1024 -0.5% 1.00x (?)
RecursiveOwnedParameter 115 115 +0.0% 1.00x
RemoveWhereFilterInts 47 47 +0.0% 1.00x
RemoveWhereFilterStrings 438 437 -0.2% 1.00x
RemoveWhereMoveStrings 712 709 -0.4% 1.00x
RemoveWhereQuadraticInts 1295 1299 +0.3% 1.00x
RemoveWhereQuadraticString 374 388 +3.7% 0.96x
RemoveWhereQuadraticStrings 2768 2772 +0.1% 1.00x (?)
RemoveWhereSwapStrings 867 862 -0.6% 1.01x (?)
ReversedArray 57 57 +0.0% 1.00x
ReversedBidirectional 16982 16972 -0.1% 1.00x (?)
ReversedDictionary 272 278 +2.2% 0.98x (?)
RomanNumbers 84490 81744 -3.3% 1.03x
SequenceAlgosArray 1582 1583 +0.1% 1.00x (?)
SequenceAlgosContiguousArray 1579 1579 +0.0% 1.00x
SequenceAlgosList 1355 1352 -0.2% 1.00x
SequenceAlgosRange 2577 2577 +0.0% 1.00x
SequenceAlgosUnfoldSequence 1103 1102 -0.1% 1.00x
SetExclusiveOr 5215 5207 -0.2% 1.00x (?)
SetExclusiveOr_OfObjects 11818 11808 -0.1% 1.00x (?)
SetIntersect 705 700 -0.7% 1.01x (?)
SetIntersect_OfObjects 1805 1760 -2.5% 1.03x
SetIsSubsetOf 355 354 -0.3% 1.00x
SetIsSubsetOf_OfObjects 461 453 -1.7% 1.02x
SetUnion 4497 4457 -0.9% 1.01x
SetUnion_OfObjects 10236 10112 -1.2% 1.01x
SevenBoom 869 885 +1.8% 0.98x (?)
Sim2DArray 599 599 +0.0% 1.00x
SortLargeExistentials 5523 5531 +0.1% 1.00x (?)
SortLettersInPlace 1014 1007 -0.7% 1.01x
SortSortedStrings 875 881 +0.7% 0.99x (?)
SortStrings 1790 1781 -0.5% 1.01x
SortStringsUnicode 2669 2633 -1.3% 1.01x
StackPromo 24869 24380 -2.0% 1.02x
StrComplexWalk 1784 1776 -0.4% 1.00x
StrToInt 3219 3231 +0.4% 1.00x
StringBuilderLong 1263 1293 +2.4% 0.98x (?)
StringBuilderWithLongSubstring 1453 1471 +1.2% 0.99x (?)
StringComparison_abnormal 784 776 -1.0% 1.01x
StringComparison_ascii 1030 1077 +4.6% 0.96x
StringComparison_emoji 822 835 +1.6% 0.98x
StringComparison_fastPrenormal 855 873 +2.1% 0.98x
StringComparison_latin1 669 683 +2.1% 0.98x
StringComparison_longSharedPrefix 942 952 +1.1% 0.99x
StringComparison_nonBMPSlowestPrenormal 1601 1602 +0.1% 1.00x (?)
StringComparison_slowerPrenormal 1715 1744 +1.7% 0.98x
StringComparison_zalgo 127520 127061 -0.4% 1.00x (?)
StringEdits 172410 174222 +1.1% 0.99x (?)
StringEnumRawValueInitialization 860 850 -1.2% 1.01x
StringFromLongWholeSubstring 21 22 +4.8% 0.95x
StringFromLongWholeSubstringGeneric 22 21 -4.5% 1.05x
StringHasPrefixAscii 2206 2205 -0.0% 1.00x
StringHasPrefixUnicode 100401 100834 +0.4% 1.00x (?)
StringHasSuffixAscii 2368 2291 -3.3% 1.03x
StringHasSuffixUnicode 102254 101481 -0.8% 1.01x
StringInterpolation 9966 9727 -2.4% 1.02x (?)
StringMatch 12840 12669 -1.3% 1.01x
StringRemoveDupes 525 502 -4.4% 1.05x
StringUTF16Builder 2739 2709 -1.1% 1.01x
StringWalk 1440 1425 -1.0% 1.01x
StringWithCString 46947 44835 -4.5% 1.05x
StringWordBuilderReservingCapacity 1770 1831 +3.4% 0.97x
SubstringEqualString 616 618 +0.3% 1.00x (?)
SubstringEquatable 1372 1415 +3.1% 0.97x
SubstringFromLongString 10 10 +0.0% 1.00x
SubstringFromLongStringGeneric 74 74 +0.0% 1.00x
SuffixAnyCollection 31 31 +0.0% 1.00x
SuffixAnySeqCRangeIter 3746 3771 +0.7% 0.99x
SuffixAnySeqCRangeIterLazy 3753 3757 +0.1% 1.00x
SuffixAnySeqCntRange 21 21 +0.0% 1.00x
SuffixAnySeqCntRangeLazy 21 20 -4.8% 1.05x
SuffixAnySequence 4949 4966 +0.3% 1.00x
SuffixAnySequenceLazy 5040 5062 +0.4% 1.00x
SuffixSequence 3619 3643 +0.7% 0.99x
SuffixSequenceLazy 3622 3640 +0.5% 1.00x
SumUsingReduce 97 102 +5.2% 0.95x
SuperChars 15887 15676 -1.3% 1.01x
TwoSum 1461 1510 +3.4% 0.97x (?)
TypeFlood 0 0 +0.0% 1.00x
UTF8Decode 304 297 -2.3% 1.02x
Walsh 433 433 +0.0% 1.00x
WordCountHistogramASCII 8080 8013 -0.8% 1.01x (?)
WordCountHistogramUTF16 15037 15093 +0.4% 1.00x (?)
WordCountUniqueASCII 2110 2112 +0.1% 1.00x (?)
WordCountUniqueUTF16 8116 8139 +0.3% 1.00x (?)
WordSplitASCII 6848 6746 -1.5% 1.02x (?)
WordSplitUTF16 8897 8643 -2.9% 1.03x (?)
XorLoop 402 402 +0.0% 1.00x
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 requested a review from atrick May 29, 2018 22:20
@swift-ci
Copy link
Contributor

Build comment file:

Summary for master full

Unexpected test results, excluded stats for ProcedureKit, Turnstile, StencilSwiftKit, ObjectMapper, Core

No regressions above thresholds

Debug-batch

debug-batch brief

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (2)
name old new delta delta_pct
LLVM.NumLLVMBytesOutput 1,588,448,938 1,581,693,794 -6,755,144 -0.43%
time.swift-driver.wall 2276.3s 2271.5s -4.7s -0.21%

debug-batch detailed

Regressed (0)
name old new delta delta_pct
Improved (2)
name old new delta delta_pct
Driver.NumDriverPipePolls 240,637 237,905 -2,732 -1.14% ✅
IRModule.NumIRBasicBlocks 4,214,727 4,117,207 -97,520 -2.31% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (72)
name old new delta delta_pct
AST.NumASTBytesAllocated 29,741,124,758 29,712,225,787 -28,898,971 -0.1%
AST.NumDecls 91,049 91,049 0 0.0%
AST.NumDependencies 162,144 162,144 0 0.0%
AST.NumImportedExternalDefinitions 1,450,771 1,450,771 0 0.0%
AST.NumInfixOperators 28,811 28,811 0 0.0%
AST.NumLinkLibraries 0 0 0 0.0%
AST.NumLoadedModules 210,580 210,580 0 0.0%
AST.NumLocalTypeDecls 16 16 0 0.0%
AST.NumObjCMethods 27,456 27,456 0 0.0%
AST.NumPostfixOperators 14 14 0 0.0%
AST.NumPrecedenceGroups 18,184 18,184 0 0.0%
AST.NumPrefixOperators 134 134 0 0.0%
AST.NumReferencedDynamicNames 208 208 0 0.0%
AST.NumReferencedMemberNames 4,093,284 4,093,284 0 0.0%
AST.NumReferencedTopLevelNames 305,021 305,021 0 0.0%
AST.NumSourceBuffers 407,985 407,985 0 0.0%
AST.NumSourceLines 2,753,784 2,753,784 0 0.0%
AST.NumSourceLinesPerSecond 1,921,525 1,928,920 7,395 0.38%
AST.NumTotalClangImportedEntities 4,706,221 4,706,221 0 0.0%
AST.NumUsedConformances 220,613 220,613 0 0.0%
Driver.ChildrenMaxRSS 68,958,396,416 68,904,970,240 -53,426,176 -0.08%
Driver.DriverDepCascadingDynamic 0 0 0 0.0%
Driver.DriverDepCascadingExternal 0 0 0 0.0%
Driver.DriverDepCascadingMember 0 0 0 0.0%
Driver.DriverDepCascadingNominal 0 0 0 0.0%
Driver.DriverDepCascadingTopLevel 0 0 0 0.0%
Driver.DriverDepDynamic 0 0 0 0.0%
Driver.DriverDepExternal 0 0 0 0.0%
Driver.DriverDepMember 0 0 0 0.0%
Driver.DriverDepNominal 0 0 0 0.0%
Driver.DriverDepTopLevel 0 0 0 0.0%
Driver.NumDriverJobsRun 18,583 18,583 0 0.0%
Driver.NumDriverJobsSkipped 0 0 0 0.0%
Driver.NumDriverPipeReads 266,806 264,175 -2,631 -0.99%
Driver.NumProcessFailures 0 0 0 0.0%
Frontend.NumProcessFailures 0 0 0 0.0%
IRModule.NumIRAliases 14,404 14,404 0 0.0%
IRModule.NumIRComdatSymbols 0 0 0 0.0%
IRModule.NumIRFunctions 2,361,212 2,352,440 -8,772 -0.37%
IRModule.NumIRGlobals 2,478,155 2,460,625 -17,530 -0.71%
IRModule.NumIRIFuncs 0 0 0 0.0%
IRModule.NumIRInsts 47,010,115 46,751,274 -258,841 -0.55%
IRModule.NumIRNamedMetaData 72,990 72,990 0 0.0%
IRModule.NumIRValueSymbols 4,287,663 4,274,714 -12,949 -0.3%
LLVM.NumLLVMBytesOutput 1,588,448,938 1,581,693,794 -6,755,144 -0.43%
Parse.NumFunctionsParsed 166,258 166,258 0 0.0%
SILModule.NumSILGenDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILGenFunctions 1,605,694 1,605,677 -17 -0.0%
SILModule.NumSILGenGlobalVariables 27,022 27,022 0 0.0%
SILModule.NumSILGenVtables 16,867 16,867 0 0.0%
SILModule.NumSILGenWitnessTables 46,504 46,504 0 0.0%
SILModule.NumSILOptDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILOptFunctions 1,506,440 1,497,978 -8,462 -0.56%
SILModule.NumSILOptGlobalVariables 54,601 54,601 0 0.0%
SILModule.NumSILOptVtables 26,169 26,169 0 0.0%
SILModule.NumSILOptWitnessTables 81,867 81,867 0 0.0%
Sema.NamedLazyMemberLoadFailureCount 24,756 24,756 0 0.0%
Sema.NamedLazyMemberLoadSuccessCount 4,193,106 4,193,106 0 0.0%
Sema.NominalTypeLookupDirectCount 31,125,297 31,125,649 352 0.0%
Sema.NumConformancesDeserialized 5,277,974 5,277,922 -52 -0.0%
Sema.NumConstraintScopes 13,241,067 13,241,067 0 0.0%
Sema.NumConstraintsConsideredForEdgeContraction 31,895,960 31,895,960 0 0.0%
Sema.NumDeclsDeserialized 35,758,291 35,673,102 -85,189 -0.24%
Sema.NumDeclsValidated 3,214,051 3,214,051 0 0.0%
Sema.NumFunctionsTypechecked 973,098 973,098 0 0.0%
Sema.NumGenericSignatureBuilders 1,749,581 1,748,537 -1,044 -0.06%
Sema.NumLazyGenericEnvironments 6,759,880 6,726,478 -33,402 -0.49%
Sema.NumLazyGenericEnvironmentsLoaded 731,412 731,397 -15 -0.0%
Sema.NumLazyIterableDeclContexts 5,677,437 5,651,729 -25,708 -0.45%
Sema.NumTypesDeserialized 37,894,638 37,773,272 -121,366 -0.32%
Sema.NumTypesValidated 4,240,512 4,240,512 0 0.0%
Sema.NumUnloadedLazyIterableDeclContexts 3,756,403 3,730,701 -25,702 -0.68%

Release

release brief

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (2)
name old new delta delta_pct
LLVM.NumLLVMBytesOutput 1,483,244,960 1,473,882,030 -9,362,930 -0.63%
time.swift-driver.wall 3854.1s 3874.2s 20.1s 0.52%

release detailed

Regressed (0)
name old new delta delta_pct
Improved (2)
name old new delta delta_pct
IRModule.NumIRInsts 34,724,657 34,374,114 -350,543 -1.01% ✅
Sema.NumLazyIterableDeclContexts 2,735,293 2,703,857 -31,436 -1.15% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (21)
name old new delta delta_pct
AST.NumImportedExternalDefinitions 685,208 685,208 0 0.0%
AST.NumLoadedModules 81,559 81,559 0 0.0%
AST.NumTotalClangImportedEntities 2,245,191 2,245,191 0 0.0%
AST.NumUsedConformances 226,078 226,078 0 0.0%
IRModule.NumIRBasicBlocks 3,697,531 3,662,353 -35,178 -0.95%
IRModule.NumIRFunctions 1,939,431 1,930,690 -8,741 -0.45%
IRModule.NumIRGlobals 2,102,618 2,086,116 -16,502 -0.78%
IRModule.NumIRValueSymbols 3,692,417 3,683,800 -8,617 -0.23%
LLVM.NumLLVMBytesOutput 1,483,244,960 1,473,882,030 -9,362,930 -0.63%
SILModule.NumSILGenFunctions 839,544 839,527 -17 -0.0%
SILModule.NumSILOptFunctions 1,351,744 1,340,657 -11,087 -0.82%
Sema.NumConformancesDeserialized 4,251,909 4,231,046 -20,863 -0.49%
Sema.NumConstraintScopes 13,174,900 13,174,900 0 0.0%
Sema.NumDeclsDeserialized 18,605,267 18,493,515 -111,752 -0.6%
Sema.NumDeclsValidated 2,669,689 2,669,689 0 0.0%
Sema.NumFunctionsTypechecked 605,658 605,658 0 0.0%
Sema.NumGenericSignatureBuilders 975,217 974,902 -315 -0.03%
Sema.NumLazyGenericEnvironments 3,513,803 3,487,176 -26,627 -0.76%
Sema.NumLazyGenericEnvironmentsLoaded 344,894 343,860 -1,034 -0.3%
Sema.NumTypesDeserialized 21,965,093 21,841,653 -123,440 -0.56%
Sema.NumTypesValidated 3,510,593 3,510,593 0 0.0%

@eeckstein eeckstein merged commit 9152e29 into swiftlang:master May 30, 2018
@eeckstein eeckstein deleted the stdlib-perf-changes branch May 30, 2018 15:53
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