Skip to content

Add value witnesses for single payload enums #12606

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

aschwaighofer
Copy link
Contributor

So far single payload enums were implemented in terms of runtime functions which
internally emitted several calls to value witnesses.

This commit adds value witnesses to get and store the enum tag side stepping the
need for witness calls as this information is statically available in many cases

/// int (getEnumTagSinglePayload)(const T enum, UINT_TYPE emptyCases)
/// Given an instance of valid single payload enum with a payload of this
/// witness table's type (e.g Optional) , get the tag of the enum.

/// void (storeEnumTagSinglePayload)(T enum, INT_TYPE whichCase,
/// UINT_TYPE emptyCases)
/// Given uninitialized memory for an instance of a single payload enum with a
/// payload of this witness table's type (e.g Optional), store the
/// tag.

A simple 'for element in array' loop in generic code operating on a
ContiguousArray of Int is ~25% faster on arm64.

rdar://31408033

So far single payload enums were implemented in terms of runtime functions which
internally emitted several calls to value witnesses.

This commit adds value witnesses to get and store the enum tag side stepping the
need for witness calls as this information is statically available in many cases

/// int (*getEnumTagSinglePayload)(const T* enum, UINT_TYPE emptyCases)
/// Given an instance of valid single payload enum with a payload of this
/// witness table's type (e.g Optional<ThisType>) , get the tag of the enum.

/// void (*storeEnumTagSinglePayload)(T* enum, INT_TYPE whichCase,
///                                   UINT_TYPE emptyCases)
/// Given uninitialized memory for an instance of a single payload enum with a
/// payload of this witness table's type (e.g Optional<ThisType>), store the
/// tag.

A simple 'for element in array' loop in generic code operating on a
ContigousArray of Int is ~25% faster on arm64.

rdar://31408033
Fast-isel does not like them
@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c538077

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test linux

@jrose-apple
Copy link
Contributor

What's the code size impact for this change?

@aschwaighofer
Copy link
Contributor Author

I don’t have numbers yet. it should somewhat even out with the removal of the array witnesses (of which there where four)

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please benchmark

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

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

It looks like the extra inhabitant value witnesses are now only used when you have an enum whose payload is a structural type, like a tuple. Can you think of a clever way around this, implementing the single payload value witnesses for tuples in terms of the single payload value witnesses of the payload type? If so, you could trim the value witness table further.

// numTags += ((emptyCases + (casesPerTagBitValue - 1U)) >> bits);
// }
// return (numTags < 256 ? 1 :
// numTags < 65536 ? 2 : 4);
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation

auto *phi = Builder.CreatePHI(int32Ty, 3);
phi->addIncoming(one, entryBB);
phi->addIncoming(numTags, notLT256BB);
return phi;
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation

@slavapestov
Copy link
Contributor

For example, would it be sufficient to say that

  • enum tag of a tuple => get enum tag of first tuple component
  • store tag into a tuple => store tag into first component

This relies on the fact that extra inhabitants of a tuple type are always the extra inhabitants of its first component. If this were to change, the above would no longer work, but maybe we can live with that restriction?

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (9)
TEST OLD NEW DELTA SPEEDUP
PopFrontUnsafePointer 4950 5748 +16.1% 0.86x (?)
ProtocolDispatch 2573 2859 +11.1% 0.90x
ProtocolDispatch2 120 130 +8.3% 0.92x
ArraySetElement 400 429 +7.2% 0.93x
ArrayAppendAscii 17790 18959 +6.6% 0.94x
Histogram 261 278 +6.5% 0.94x
Chars 561 594 +5.9% 0.94x
ObjectiveCBridgeFromNSStringForced 1666 1756 +5.4% 0.95x (?)
DictionarySwap 391 412 +5.4% 0.95x
Improvement (14)
TEST OLD NEW DELTA SPEEDUP
DropWhileAnySequence 6873 5666 -17.6% 1.21x
CaptureProp 4577 3938 -14.0% 1.16x
LazilyFilteredArrayContains 18433 16057 -12.9% 1.15x
ArrayAppendLatin1 43248 38754 -10.4% 1.12x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 86049 77880 -9.5% 1.10x (?)
MapReduceAnyCollection 373 341 -8.6% 1.09x
DropWhileSequence 1532 1411 -7.9% 1.09x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 95809 88375 -7.8% 1.08x (?)
RangeAssignment 343 317 -7.6% 1.08x
ObjectiveCBridgeStubNSDateRefAccess 343 321 -6.4% 1.07x
ObjectiveCBridgeFromNSArrayAnyObject 21087 19846 -5.9% 1.06x
DropLastAnyCollection 20 19 -5.0% 1.05x
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 4811 4574 -4.9% 1.05x (?)
ObjectiveCBridgeStubToNSDate 13853 13191 -4.8% 1.05x (?)
No Changes (311)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 2768 2779 +0.4% 1.00x (?)
AnyHashableWithAClass 63203 62984 -0.3% 1.00x (?)
Array2D 1795 1798 +0.2% 1.00x (?)
ArrayAppend 1006 1003 -0.3% 1.00x (?)
ArrayAppendArrayOfInt 564 565 +0.2% 1.00x (?)
ArrayAppendFromGeneric 565 565 +0.0% 1.00x
ArrayAppendGenericStructs 1135 1135 +0.0% 1.00x
ArrayAppendLazyMap 871 871 +0.0% 1.00x
ArrayAppendOptionals 1135 1135 +0.0% 1.00x
ArrayAppendRepeatCol 942 941 -0.1% 1.00x (?)
ArrayAppendReserved 780 780 +0.0% 1.00x
ArrayAppendSequence 917 940 +2.5% 0.98x
ArrayAppendStrings 14134 14148 +0.1% 1.00x (?)
ArrayAppendToFromGeneric 564 565 +0.2% 1.00x (?)
ArrayAppendToGeneric 564 564 +0.0% 1.00x
ArrayAppendUTF16 38912 39366 +1.2% 0.99x (?)
ArrayInClass 59 58 -1.7% 1.02x (?)
ArrayLiteral 0 0 +0.0% 1.00x
ArrayOfGenericPOD 207 207 +0.0% 1.00x
ArrayOfGenericRef 3745 3750 +0.1% 1.00x (?)
ArrayOfPOD 156 156 +0.0% 1.00x
ArrayOfRef 3681 3687 +0.2% 1.00x (?)
ArrayPlusEqualArrayOfInt 564 563 -0.2% 1.00x (?)
ArrayPlusEqualFiveElementCollection 4319 4333 +0.3% 1.00x (?)
ArrayPlusEqualSingleElementCollection 1005 1003 -0.2% 1.00x (?)
ArrayPlusEqualThreeElements 1534 1538 +0.3% 1.00x (?)
ArraySubscript 1412 1419 +0.5% 1.00x (?)
ArrayValueProp 5 5 +0.0% 1.00x
ArrayValueProp2 5 5 +0.0% 1.00x
ArrayValueProp3 5 5 +0.0% 1.00x
ArrayValueProp4 5 5 +0.0% 1.00x
BitCount 135 136 +0.7% 0.99x (?)
ByteSwap 110 109 -0.9% 1.01x (?)
CStringLongAscii 4557 4466 -2.0% 1.02x (?)
CStringLongNonAscii 2159 2120 -1.8% 1.02x
CStringShortAscii 4497 4549 +1.2% 0.99x (?)
Calculator 34 34 +0.0% 1.00x
CharIndexing_ascii_unicodeScalars 12708 12676 -0.3% 1.00x (?)
CharIndexing_ascii_unicodeScalars_Backwards 10650 10627 -0.2% 1.00x (?)
CharIndexing_chinese_unicodeScalars 9652 9612 -0.4% 1.00x (?)
CharIndexing_chinese_unicodeScalars_Backwards 8071 8067 -0.0% 1.00x (?)
CharIndexing_japanese_unicodeScalars 15193 15170 -0.2% 1.00x (?)
CharIndexing_japanese_unicodeScalars_Backwards 12703 12709 +0.0% 1.00x (?)
CharIndexing_korean_unicodeScalars 12318 12297 -0.2% 1.00x (?)
CharIndexing_korean_unicodeScalars_Backwards 10305 10307 +0.0% 1.00x (?)
CharIndexing_punctuatedJapanese_unicodeScalars 2370 2331 -1.6% 1.02x (?)
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 2005 1981 -1.2% 1.01x (?)
CharIndexing_punctuated_unicodeScalars 2940 2912 -1.0% 1.01x (?)
CharIndexing_punctuated_unicodeScalars_Backwards 2476 2461 -0.6% 1.01x
CharIndexing_russian_unicodeScalars 10602 10576 -0.2% 1.00x (?)
CharIndexing_russian_unicodeScalars_Backwards 8860 8866 +0.1% 1.00x (?)
CharIndexing_tweet_unicodeScalars 24974 24993 +0.1% 1.00x (?)
CharIndexing_tweet_unicodeScalars_Backwards 20921 20917 -0.0% 1.00x (?)
CharIndexing_utf16_unicodeScalars 76371 76378 +0.0% 1.00x (?)
CharIndexing_utf16_unicodeScalars_Backwards 57007 56982 -0.0% 1.00x (?)
CharIteration_ascii_unicodeScalars 14551 14921 +2.5% 0.98x
CharIteration_ascii_unicodeScalars_Backwards 15644 15628 -0.1% 1.00x (?)
CharIteration_chinese_unicodeScalars 11010 11303 +2.7% 0.97x
CharIteration_chinese_unicodeScalars_Backwards 11844 11830 -0.1% 1.00x (?)
CharIteration_japanese_unicodeScalars 17389 17855 +2.7% 0.97x
CharIteration_japanese_unicodeScalars_Backwards 18730 18716 -0.1% 1.00x (?)
CharIteration_korean_unicodeScalars 14089 14469 +2.7% 0.97x
CharIteration_korean_unicodeScalars_Backwards 15168 15153 -0.1% 1.00x (?)
CharIteration_punctuatedJapanese_unicodeScalars 2642 2703 +2.3% 0.98x
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 2825 2810 -0.5% 1.01x
CharIteration_punctuated_unicodeScalars 3299 3382 +2.5% 0.98x
CharIteration_punctuated_unicodeScalars_Backwards 3536 3525 -0.3% 1.00x (?)
CharIteration_russian_unicodeScalars 12120 12426 +2.5% 0.98x
CharIteration_russian_unicodeScalars_Backwards 13033 13017 -0.1% 1.00x (?)
CharIteration_tweet_unicodeScalars 28666 29408 +2.6% 0.97x
CharIteration_tweet_unicodeScalars_Backwards 30912 30923 +0.0% 1.00x (?)
CharIteration_utf16_unicodeScalars 73923 74027 +0.1% 1.00x
CharIteration_utf16_unicodeScalars_Backwards 92140 92074 -0.1% 1.00x (?)
CharacterLiteralsLarge 5625 5624 -0.0% 1.00x (?)
CharacterLiteralsSmall 379 381 +0.5% 0.99x
ClassArrayGetter 12 12 +0.0% 1.00x
DeadArray 174 171 -1.7% 1.02x
Dictionary 536 533 -0.6% 1.01x (?)
Dictionary2 1718 1735 +1.0% 0.99x (?)
Dictionary2OfObjects 3006 3012 +0.2% 1.00x (?)
Dictionary3 442 443 +0.2% 1.00x (?)
Dictionary3OfObjects 786 782 -0.5% 1.01x
DictionaryBridge 2367 2285 -3.5% 1.04x (?)
DictionaryGroup 258 259 +0.4% 1.00x (?)
DictionaryGroupOfObjects 1691 1697 +0.4% 1.00x (?)
DictionaryLiteral 1408 1396 -0.9% 1.01x (?)
DictionaryOfObjects 2077 2076 -0.0% 1.00x (?)
DictionaryRemove 2352 2346 -0.3% 1.00x (?)
DictionaryRemoveOfObjects 21629 21679 +0.2% 1.00x (?)
DictionarySwapOfObjects 6965 6910 -0.8% 1.01x (?)
DropFirstAnyCollection 52 52 +0.0% 1.00x
DropFirstAnyCollectionLazy 73193 72553 -0.9% 1.01x (?)
DropFirstAnySeqCRangeIter 26307 26678 +1.4% 0.99x
DropFirstAnySeqCRangeIterLazy 26309 26693 +1.5% 0.99x (?)
DropFirstAnySeqCntRange 48 48 +0.0% 1.00x
DropFirstAnySeqCntRangeLazy 48 47 -2.1% 1.02x
DropFirstAnySequence 5929 5905 -0.4% 1.00x (?)
DropFirstAnySequenceLazy 5957 6222 +4.4% 0.96x
DropFirstArray 28 29 +3.6% 0.97x
DropFirstArrayLazy 29 28 -3.4% 1.04x (?)
DropFirstCountableRange 17 17 +0.0% 1.00x
DropFirstCountableRangeLazy 17 17 +0.0% 1.00x
DropFirstSequence 1905 1905 +0.0% 1.00x
DropFirstSequenceLazy 1835 1835 +0.0% 1.00x
DropLastAnyCollectionLazy 24401 24170 -0.9% 1.01x (?)
DropLastAnySeqCRangeIter 4448 4406 -0.9% 1.01x (?)
DropLastAnySeqCRangeIterLazy 4448 4406 -0.9% 1.01x
DropLastAnySeqCntRange 15 15 +0.0% 1.00x
DropLastAnySeqCntRangeLazy 15 15 +0.0% 1.00x
DropLastAnySequence 6344 6302 -0.7% 1.01x
DropLastAnySequenceLazy 6295 6257 -0.6% 1.01x (?)
DropLastArray 7 7 +0.0% 1.00x
DropLastArrayLazy 7 7 +0.0% 1.00x
DropLastCountableRange 6 6 +0.0% 1.00x
DropLastCountableRangeLazy 6 6 +0.0% 1.00x
DropLastSequence 583 582 -0.2% 1.00x (?)
DropLastSequenceLazy 582 581 -0.2% 1.00x (?)
DropWhileAnyCollection 64 64 +0.0% 1.00x
DropWhileAnyCollectionLazy 83 85 +2.4% 0.98x
DropWhileAnySeqCRangeIter 21267 20556 -3.3% 1.03x (?)
DropWhileAnySeqCRangeIterLazy 85 84 -1.2% 1.01x
DropWhileAnySeqCntRange 60 60 +0.0% 1.00x
DropWhileAnySeqCntRangeLazy 85 83 -2.4% 1.02x
DropWhileAnySequenceLazy 1823 1824 +0.1% 1.00x (?)
DropWhileArray 40 40 +0.0% 1.00x
DropWhileArrayLazy 74 77 +4.1% 0.96x
DropWhileCountableRange 18 18 +0.0% 1.00x
DropWhileCountableRangeLazy 66 66 +0.0% 1.00x
DropWhileSequenceLazy 44 44 +0.0% 1.00x
EqualStringSubstring 368 365 -0.8% 1.01x
EqualSubstringString 367 367 +0.0% 1.00x
EqualSubstringSubstring 366 368 +0.5% 0.99x
EqualSubstringSubstringGenericEquatable 371 370 -0.3% 1.00x (?)
ErrorHandling 1941 1938 -0.2% 1.00x (?)
ExclusivityGlobal 2 2 +0.0% 1.00x
ExclusivityInMatSet 17 17 +0.0% 1.00x
ExclusivityIndependent 2 2 +0.0% 1.00x
FilterEvenUsingReduce 1227 1221 -0.5% 1.00x (?)
FilterEvenUsingReduceInto 137 137 +0.0% 1.00x
FrequenciesUsingReduce 6999 7012 +0.2% 1.00x (?)
FrequenciesUsingReduceInto 3899 3888 -0.3% 1.00x (?)
Hanoi 3363 3440 +2.3% 0.98x
HashTest 1617 1626 +0.6% 0.99x (?)
Integrate 235 235 +0.0% 1.00x
IterateData 1289 1282 -0.5% 1.01x
Join 359 352 -1.9% 1.02x (?)
LazilyFilteredArrays 62764 62747 -0.0% 1.00x (?)
LazilyFilteredRange 3529 3527 -0.1% 1.00x (?)
LessSubstringSubstring 368 367 -0.3% 1.00x
LessSubstringSubstringGenericComparable 368 367 -0.3% 1.00x (?)
LinkedList 6593 6610 +0.3% 1.00x (?)
MapReduce 340 341 +0.3% 1.00x (?)
MapReduceAnyCollectionShort 1993 1980 -0.7% 1.01x (?)
MapReduceClass 2893 2892 -0.0% 1.00x (?)
MapReduceClassShort 4344 4343 -0.0% 1.00x (?)
MapReduceLazyCollection 11 11 +0.0% 1.00x
MapReduceLazyCollectionShort 4 4 +0.0% 1.00x
MapReduceLazySequence 85 85 +0.0% 1.00x
MapReduceSequence 415 415 +0.0% 1.00x
MapReduceShort 1939 1900 -2.0% 1.02x (?)
MapReduceShortString 20 20 +0.0% 1.00x
MapReduceString 95 97 +2.1% 0.98x (?)
Memset 221 221 +0.0% 1.00x
MonteCarloE 9759 9792 +0.3% 1.00x (?)
MonteCarloPi 41460 41484 +0.1% 1.00x (?)
NSDictionaryCastToSwift 4984 4977 -0.1% 1.00x (?)
NSError 280 278 -0.7% 1.01x (?)
NSStringConversion 327 332 +1.5% 0.98x
NopDeinit 20181 20177 -0.0% 1.00x (?)
ObjectAllocation 169 169 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObjectForced 3266 3263 -0.1% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 36930 36121 -2.2% 1.02x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 31197 31174 -0.1% 1.00x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 111712 109532 -2.0% 1.02x (?)
ObjectiveCBridgeFromNSSetAnyObject 60585 59930 -1.1% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 3980 3947 -0.8% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 63429 60771 -4.2% 1.04x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 64931 61894 -4.7% 1.05x (?)
ObjectiveCBridgeFromNSString 932 932 +0.0% 1.00x
ObjectiveCBridgeStubDataAppend 3586 3591 +0.1% 1.00x (?)
ObjectiveCBridgeStubDateAccess 171 171 +0.0% 1.00x
ObjectiveCBridgeStubDateMutation 257 257 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 23330 23239 -0.4% 1.00x (?)
ObjectiveCBridgeStubFromNSDate 3456 3608 +4.4% 0.96x
ObjectiveCBridgeStubFromNSDateRef 4008 4004 -0.1% 1.00x (?)
ObjectiveCBridgeStubFromNSString 514 498 -3.1% 1.03x (?)
ObjectiveCBridgeStubFromNSStringRef 140 140 +0.0% 1.00x
ObjectiveCBridgeStubNSDataAppend 2258 2238 -0.9% 1.01x (?)
ObjectiveCBridgeStubNSDateMutationRef 12473 12241 -1.9% 1.02x (?)
ObjectiveCBridgeStubToArrayOfNSString 27060 27501 +1.6% 0.98x (?)
ObjectiveCBridgeStubToNSDateRef 3127 3137 +0.3% 1.00x (?)
ObjectiveCBridgeStubToNSString 1409 1417 +0.6% 0.99x (?)
ObjectiveCBridgeStubToNSStringRef 110 109 -0.9% 1.01x (?)
ObjectiveCBridgeStubURLAppendPath 203048 198387 -2.3% 1.02x (?)
ObjectiveCBridgeStubURLAppendPathRef 203286 198215 -2.5% 1.03x (?)
ObjectiveCBridgeToNSArray 27405 27186 -0.8% 1.01x (?)
ObjectiveCBridgeToNSDictionary 43423 42726 -1.6% 1.02x (?)
ObjectiveCBridgeToNSSet 37253 37414 +0.4% 1.00x (?)
ObjectiveCBridgeToNSString 1198 1196 -0.2% 1.00x (?)
ObserverClosure 2183 2184 +0.0% 1.00x (?)
ObserverForwarderStruct 842 861 +2.3% 0.98x (?)
ObserverPartiallyAppliedMethod 3579 3570 -0.3% 1.00x (?)
ObserverUnappliedMethod 2304 2305 +0.0% 1.00x (?)
OpenClose 3 3 +0.0% 1.00x
Phonebook 5770 5876 +1.8% 0.98x (?)
PolymorphicCalls 16 16 +0.0% 1.00x
PopFrontArray 1203 1203 +0.0% 1.00x
PopFrontArrayGeneric 1227 1221 -0.5% 1.00x (?)
PrefixAnyCollection 52 52 +0.0% 1.00x
PrefixAnyCollectionLazy 73064 72433 -0.9% 1.01x (?)
PrefixAnySeqCRangeIter 20571 20515 -0.3% 1.00x (?)
PrefixAnySeqCRangeIterLazy 20594 20503 -0.4% 1.00x (?)
PrefixAnySeqCntRange 48 48 +0.0% 1.00x
PrefixAnySeqCntRangeLazy 48 48 +0.0% 1.00x
PrefixAnySequence 5117 4886 -4.5% 1.05x
PrefixAnySequenceLazy 5110 4998 -2.2% 1.02x (?)
PrefixArray 29 29 +0.0% 1.00x
PrefixArrayLazy 29 29 +0.0% 1.00x
PrefixCountableRange 17 17 +0.0% 1.00x
PrefixCountableRangeLazy 17 17 +0.0% 1.00x
PrefixSequence 1430 1430 +0.0% 1.00x
PrefixSequenceLazy 1377 1377 +0.0% 1.00x
PrefixWhileAnyCollection 87 87 +0.0% 1.00x
PrefixWhileAnyCollectionLazy 62 62 +0.0% 1.00x
PrefixWhileAnySeqCRangeIter 12189 12053 -1.1% 1.01x (?)
PrefixWhileAnySeqCRangeIterLazy 62 62 +0.0% 1.00x
PrefixWhileAnySeqCntRange 83 83 +0.0% 1.00x
PrefixWhileAnySeqCntRangeLazy 63 63 +0.0% 1.00x
PrefixWhileAnySequence 13527 13404 -0.9% 1.01x
PrefixWhileAnySequenceLazy 1355 1355 +0.0% 1.00x
PrefixWhileArray 64 64 +0.0% 1.00x
PrefixWhileArrayLazy 35 35 +0.0% 1.00x
PrefixWhileCountableRange 28 28 +0.0% 1.00x
PrefixWhileCountableRangeLazy 17 17 +0.0% 1.00x
PrefixWhileSequence 347 334 -3.7% 1.04x (?)
PrefixWhileSequenceLazy 26 26 +0.0% 1.00x
Prims 704 729 +3.6% 0.97x
PrimsSplit 712 709 -0.4% 1.00x (?)
RC4 161 161 +0.0% 1.00x
RGBHistogram 2075 2068 -0.3% 1.00x (?)
RGBHistogramOfObjects 21908 21952 +0.2% 1.00x (?)
RangeIterationSigned 126 127 +0.8% 0.99x (?)
RangeIterationSigned64 143 143 +0.0% 1.00x
RangeIterationUnsigned 143 143 +0.0% 1.00x
RecursiveOwnedParameter 2184 2168 -0.7% 1.01x
ReversedArray 42 42 +0.0% 1.00x
ReversedBidirectional 27491 27337 -0.6% 1.01x (?)
ReversedDictionary 101 99 -2.0% 1.02x (?)
SetExclusiveOr 2670 2644 -1.0% 1.01x (?)
SetExclusiveOr_OfObjects 7639 7679 +0.5% 0.99x (?)
SetIntersect 256 255 -0.4% 1.00x (?)
SetIntersect_OfObjects 1619 1613 -0.4% 1.00x (?)
SetIsSubsetOf 301 301 +0.0% 1.00x
SetIsSubsetOf_OfObjects 361 361 +0.0% 1.00x
SetUnion 2455 2359 -3.9% 1.04x (?)
SetUnion_OfObjects 6324 6334 +0.2% 1.00x (?)
SevenBoom 1421 1433 +0.8% 0.99x (?)
Sim2DArray 323 323 +0.0% 1.00x
SortLargeExistentials 7832 7885 +0.7% 0.99x
SortLettersInPlace 1073 1076 +0.3% 1.00x (?)
SortSortedStrings 861 844 -2.0% 1.02x (?)
SortStrings 1601 1607 +0.4% 1.00x (?)
SortStringsUnicode 7858 7695 -2.1% 1.02x
StackPromo 21543 21417 -0.6% 1.01x (?)
StaticArray 5 5 +0.0% 1.00x
StrComplexWalk 1506 1561 +3.7% 0.96x
StrToInt 1753 1798 +2.6% 0.97x
StringAdder 3300 3307 +0.2% 1.00x (?)
StringBuilder 946 962 +1.7% 0.98x (?)
StringBuilderLong 871 865 -0.7% 1.01x (?)
StringEdits 160908 161593 +0.4% 1.00x (?)
StringEnumRawValueInitialization 761 759 -0.3% 1.00x (?)
StringEqualPointerComparison 343 343 +0.0% 1.00x
StringFromLongWholeSubstring 168 166 -1.2% 1.01x (?)
StringFromLongWholeSubstringGeneric 81 81 +0.0% 1.00x
StringHasPrefix 8 8 +0.0% 1.00x
StringHasPrefixUnicode 14244 13784 -3.2% 1.03x (?)
StringHasSuffix 8 8 +0.0% 1.00x
StringHasSuffixUnicode 57705 57841 +0.2% 1.00x (?)
StringInterpolation 10105 10101 -0.0% 1.00x (?)
StringMatch 6998 7239 +3.4% 0.97x
StringUTF16Builder 1776 1775 -0.1% 1.00x (?)
StringWalk 1410 1416 +0.4% 1.00x
StringWithCString 57625 57571 -0.1% 1.00x (?)
SubstringComparable 1554 1526 -1.8% 1.02x (?)
SubstringEqualString 1365 1359 -0.4% 1.00x (?)
SubstringEquatable 3541 3531 -0.3% 1.00x (?)
SubstringFromLongString 10 10 +0.0% 1.00x
SubstringFromLongStringGeneric 69 68 -1.4% 1.01x (?)
SuffixAnyCollection 20 20 +0.0% 1.00x
SuffixAnyCollectionLazy 24407 24120 -1.2% 1.01x (?)
SuffixAnySeqCRangeIter 4757 4715 -0.9% 1.01x
SuffixAnySeqCRangeIterLazy 4757 4715 -0.9% 1.01x
SuffixAnySeqCntRange 15 15 +0.0% 1.00x
SuffixAnySeqCntRangeLazy 15 15 +0.0% 1.00x
SuffixAnySequence 6329 6286 -0.7% 1.01x (?)
SuffixAnySequenceLazy 6334 6293 -0.6% 1.01x
SuffixArray 7 7 +0.0% 1.00x
SuffixArrayLazy 7 7 +0.0% 1.00x
SuffixCountableRange 6 6 +0.0% 1.00x
SuffixCountableRangeLazy 6 6 +0.0% 1.00x
SuffixSequence 4374 4354 -0.5% 1.00x (?)
SuffixSequenceLazy 4372 4353 -0.4% 1.00x
SumUsingReduce 92 92 +0.0% 1.00x
SumUsingReduceInto 91 91 +0.0% 1.00x
SuperChars 78311 78523 +0.3% 1.00x (?)
TwoSum 890 901 +1.2% 0.99x (?)
TypeFlood 0 0 +0.0% 1.00x
UTF8Decode 243 243 +0.0% 1.00x
Walsh 352 354 +0.6% 0.99x (?)
XorLoop 326 326 +0.0% 1.00x

Unoptimized (Onone)

Regression (3)
TEST OLD NEW DELTA SPEEDUP
OpenClose 370 437 +18.1% 0.85x
PopFrontUnsafePointer 6598 7612 +15.4% 0.87x
NSStringConversion 360 381 +5.8% 0.94x
Improvement (60)
TEST OLD NEW DELTA SPEEDUP
SetIntersect 11909 7714 -35.2% 1.54x
SetIsSubsetOf 1808 1274 -29.5% 1.42x
StrToInt 119080 94767 -20.4% 1.26x
SetExclusiveOr 21820 17367 -20.4% 1.26x
TwoSum 4192 3669 -12.5% 1.14x
ArrayAppendLatin1 77325 68215 -11.8% 1.13x
DropWhileAnySequence 17634 15611 -11.5% 1.13x
DropWhileSequence 16598 14730 -11.3% 1.13x
Histogram 8853 7927 -10.5% 1.12x
CharIndexing_chinese_unicodeScalars 368499 330543 -10.3% 1.11x
CharIndexing_japanese_unicodeScalars 583411 523563 -10.3% 1.11x
CharIndexing_korean_unicodeScalars 471964 425003 -10.0% 1.11x
CharIndexing_ascii_unicodeScalars 486301 438603 -9.8% 1.11x
CharIndexing_tweet_unicodeScalars 958876 868892 -9.4% 1.10x
CharIndexing_punctuated_unicodeScalars 105766 96052 -9.2% 1.10x
ArrayAppendUTF16 74381 67789 -8.9% 1.10x
CharIndexing_punctuatedJapanese_unicodeScalars 82944 75719 -8.7% 1.10x
SetIntersect_OfObjects 11884 10869 -8.5% 1.09x
CharIndexing_russian_unicodeScalars 401216 369030 -8.0% 1.09x (?)
ObjectiveCBridgeFromNSString 3776 3476 -7.9% 1.09x
SetIsSubsetOf_OfObjects 1492 1377 -7.7% 1.08x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 100507 92895 -7.6% 1.08x
ArrayAppendReserved 4388 4063 -7.4% 1.08x
DropFirstSequenceLazy 13827 12866 -7.0% 1.07x
DropWhileSequenceLazy 12935 12061 -6.8% 1.07x
PrefixSequenceLazy 11153 10401 -6.7% 1.07x
PrefixSequence 11114 10390 -6.5% 1.07x
FrequenciesUsingReduceInto 8612 8058 -6.4% 1.07x
DropFirstSequence 13829 12949 -6.4% 1.07x
CharIteration_punctuatedJapanese_unicodeScalars 32440 30384 -6.3% 1.07x
ArrayAppendAscii 50357 47248 -6.2% 1.07x
CharIndexing_punctuated_unicodeScalars_Backwards 111771 104933 -6.1% 1.07x
MapReduceLazySequence 28464 26737 -6.1% 1.06x
ObjectiveCBridgeFromNSArrayAnyObject 23452 22057 -5.9% 1.06x
ArrayAppendSequence 72955 68679 -5.9% 1.06x
Dictionary2 3305 3115 -5.7% 1.06x (?)
DropFirstAnySequenceLazy 14864 14019 -5.7% 1.06x
PrefixAnySequenceLazy 12162 11472 -5.7% 1.06x
DropFirstAnySequence 14882 14039 -5.7% 1.06x
PrefixAnySequence 12134 11448 -5.7% 1.06x
CharIndexing_russian_unicodeScalars_Backwards 426519 402936 -5.5% 1.06x
CharIndexing_japanese_unicodeScalars_Backwards 611233 577626 -5.5% 1.06x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 89528 84648 -5.5% 1.06x
PrefixWhileAnySequenceLazy 12576 11902 -5.4% 1.06x
RGBHistogram 32783 31035 -5.3% 1.06x
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 53851 50987 -5.3% 1.06x
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7465 7068 -5.3% 1.06x
DropWhileAnySequenceLazy 14206 13452 -5.3% 1.06x
PrefixWhileSequenceLazy 11693 11073 -5.3% 1.06x
CharIndexing_chinese_unicodeScalars_Backwards 385417 365248 -5.2% 1.06x
ArrayAppend 4638 4396 -5.2% 1.06x
CharIteration_russian_unicodeScalars_Backwards 256615 243276 -5.2% 1.05x
CharIndexing_ascii_unicodeScalars_Backwards 510314 483798 -5.2% 1.05x
CharIndexing_tweet_unicodeScalars_Backwards 1016337 964399 -5.1% 1.05x
CharIteration_chinese_unicodeScalars_Backwards 233926 222154 -5.0% 1.05x
CharIteration_ascii_unicodeScalars_Backwards 307230 291853 -5.0% 1.05x
CharIndexing_korean_unicodeScalars_Backwards 498584 473684 -5.0% 1.05x
CharIteration_punctuated_unicodeScalars_Backwards 67641 64271 -5.0% 1.05x
StringHasSuffix 2003 1906 -4.8% 1.05x
StackPromo 97310 92669 -4.8% 1.05x
No Changes (271)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 4690 4695 +0.1% 1.00x (?)
AnyHashableWithAClass 79463 79947 +0.6% 0.99x
Array2D 611058 611740 +0.1% 1.00x (?)
ArrayAppendArrayOfInt 618 617 -0.2% 1.00x (?)
ArrayAppendFromGeneric 620 621 +0.2% 1.00x (?)
ArrayAppendGenericStructs 1197 1192 -0.4% 1.00x
ArrayAppendLazyMap 217036 209332 -3.5% 1.04x
ArrayAppendOptionals 1195 1192 -0.3% 1.00x (?)
ArrayAppendRepeatCol 220856 219465 -0.6% 1.01x (?)
ArrayAppendStrings 14288 14296 +0.1% 1.00x (?)
ArrayAppendToFromGeneric 621 619 -0.3% 1.00x
ArrayAppendToGeneric 622 620 -0.3% 1.00x (?)
ArrayInClass 6153 6254 +1.6% 0.98x
ArrayLiteral 1661 1658 -0.2% 1.00x (?)
ArrayOfGenericPOD 1221 1223 +0.2% 1.00x
ArrayOfGenericRef 9520 9405 -1.2% 1.01x
ArrayOfPOD 746 746 +0.0% 1.00x
ArrayOfRef 8788 8729 -0.7% 1.01x (?)
ArrayPlusEqualArrayOfInt 620 617 -0.5% 1.00x (?)
ArrayPlusEqualFiveElementCollection 291586 285342 -2.1% 1.02x (?)
ArrayPlusEqualSingleElementCollection 288248 279445 -3.1% 1.03x (?)
ArrayPlusEqualThreeElements 10340 10238 -1.0% 1.01x (?)
ArraySetElement 4517 4517 +0.0% 1.00x
ArraySubscript 82463 84089 +2.0% 0.98x
ArrayValueProp 3401 3401 +0.0% 1.00x
ArrayValueProp2 17864 17210 -3.7% 1.04x
ArrayValueProp3 3999 4007 +0.2% 1.00x (?)
ArrayValueProp4 3969 3958 -0.3% 1.00x (?)
BitCount 1378 1434 +4.1% 0.96x
ByteSwap 3769 3880 +2.9% 0.97x
CStringLongAscii 4624 4503 -2.6% 1.03x
CStringLongNonAscii 2280 2214 -2.9% 1.03x
CStringShortAscii 8251 8242 -0.1% 1.00x (?)
Calculator 1060 1094 +3.2% 0.97x
CaptureProp 117169 112936 -3.6% 1.04x
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 87475 83534 -4.5% 1.05x
CharIndexing_utf16_unicodeScalars 521681 500346 -4.1% 1.04x
CharIndexing_utf16_unicodeScalars_Backwards 554499 539115 -2.8% 1.03x
CharIteration_ascii_unicodeScalars 176814 172082 -2.7% 1.03x
CharIteration_chinese_unicodeScalars 132589 130069 -1.9% 1.02x
CharIteration_japanese_unicodeScalars 210779 206315 -2.1% 1.02x (?)
CharIteration_japanese_unicodeScalars_Backwards 369915 352519 -4.7% 1.05x
CharIteration_korean_unicodeScalars 170489 167110 -2.0% 1.02x (?)
CharIteration_korean_unicodeScalars_Backwards 297522 285186 -4.1% 1.04x
CharIteration_punctuated_unicodeScalars 39428 38394 -2.6% 1.03x (?)
CharIteration_russian_unicodeScalars 146847 143466 -2.3% 1.02x
CharIteration_tweet_unicodeScalars 348112 339730 -2.4% 1.02x
CharIteration_tweet_unicodeScalars_Backwards 611192 588784 -3.7% 1.04x
CharIteration_utf16_unicodeScalars 195704 190462 -2.7% 1.03x
CharIteration_utf16_unicodeScalars_Backwards 383359 369064 -3.7% 1.04x
CharacterLiteralsLarge 5837 5814 -0.4% 1.00x (?)
CharacterLiteralsSmall 654 664 +1.5% 0.98x
Chars 47624 46942 -1.4% 1.01x
ClassArrayGetter 996 986 -1.0% 1.01x
DeadArray 106197 105807 -0.4% 1.00x (?)
Dictionary 2919 2845 -2.5% 1.03x
Dictionary2OfObjects 5689 5658 -0.5% 1.01x (?)
Dictionary3 1249 1231 -1.4% 1.01x
Dictionary3OfObjects 2187 2163 -1.1% 1.01x (?)
DictionaryBridge 2469 2381 -3.6% 1.04x (?)
DictionaryGroup 5060 5112 +1.0% 0.99x
DictionaryGroupOfObjects 7925 7777 -1.9% 1.02x
DictionaryLiteral 8170 8127 -0.5% 1.01x (?)
DictionaryOfObjects 6289 6221 -1.1% 1.01x (?)
DictionaryRemove 20477 20070 -2.0% 1.02x
DictionaryRemoveOfObjects 56159 55893 -0.5% 1.00x (?)
DictionarySwap 5005 4847 -3.2% 1.03x
DictionarySwapOfObjects 21814 21880 +0.3% 1.00x (?)
DropFirstAnyCollection 19274 19226 -0.2% 1.00x (?)
DropFirstAnyCollectionLazy 135248 130459 -3.5% 1.04x
DropFirstAnySeqCRangeIter 28773 29134 +1.3% 0.99x (?)
DropFirstAnySeqCRangeIterLazy 28721 28936 +0.7% 0.99x (?)
DropFirstAnySeqCntRange 19180 19190 +0.1% 1.00x (?)
DropFirstAnySeqCntRangeLazy 19319 19403 +0.4% 1.00x
DropFirstArray 6036 5751 -4.7% 1.05x
DropFirstArrayLazy 41963 42130 +0.4% 1.00x (?)
DropFirstCountableRange 446 443 -0.7% 1.01x
DropFirstCountableRangeLazy 38234 38106 -0.3% 1.00x (?)
DropLastAnyCollection 6411 6416 +0.1% 1.00x (?)
DropLastAnyCollectionLazy 44156 43530 -1.4% 1.01x
DropLastAnySeqCRangeIter 44749 44273 -1.1% 1.01x (?)
DropLastAnySeqCRangeIterLazy 44880 44303 -1.3% 1.01x
DropLastAnySeqCntRange 6427 6422 -0.1% 1.00x (?)
DropLastAnySeqCntRangeLazy 6430 6416 -0.2% 1.00x (?)
DropLastAnySequence 31683 30810 -2.8% 1.03x
DropLastAnySequenceLazy 31684 30878 -2.5% 1.03x
DropLastArray 2020 1948 -3.6% 1.04x
DropLastArrayLazy 13995 14029 +0.2% 1.00x (?)
DropLastCountableRange 154 153 -0.6% 1.01x
DropLastCountableRangeLazy 12788 12702 -0.7% 1.01x (?)
DropLastSequence 31432 30465 -3.1% 1.03x
DropLastSequenceLazy 31510 30404 -3.5% 1.04x
DropWhileAnyCollection 25120 25232 +0.4% 1.00x (?)
DropWhileAnyCollectionLazy 27042 27153 +0.4% 1.00x (?)
DropWhileAnySeqCRangeIter 31027 30481 -1.8% 1.02x (?)
DropWhileAnySeqCRangeIterLazy 27213 27201 -0.0% 1.00x (?)
DropWhileAnySeqCntRange 25009 25170 +0.6% 0.99x
DropWhileAnySeqCntRangeLazy 27257 27149 -0.4% 1.00x
DropWhileArray 9415 9297 -1.3% 1.01x
DropWhileArrayLazy 16492 16292 -1.2% 1.01x
DropWhileCountableRange 6300 6265 -0.6% 1.01x
DropWhileCountableRangeLazy 26199 26473 +1.0% 0.99x
EqualStringSubstring 635 636 +0.2% 1.00x (?)
EqualSubstringString 634 636 +0.3% 1.00x (?)
EqualSubstringSubstring 750 747 -0.4% 1.00x
EqualSubstringSubstringGenericEquatable 397 397 +0.0% 1.00x
ErrorHandling 6416 6377 -0.6% 1.01x (?)
ExclusivityGlobal 165 169 +2.4% 0.98x
ExclusivityInMatSet 287 288 +0.3% 1.00x (?)
ExclusivityIndependent 117 117 +0.0% 1.00x
FilterEvenUsingReduce 4053 4014 -1.0% 1.01x (?)
FilterEvenUsingReduceInto 2360 2354 -0.3% 1.00x (?)
FrequenciesUsingReduce 15078 14669 -2.7% 1.03x (?)
Hanoi 18169 18159 -0.1% 1.00x (?)
HashTest 16487 16392 -0.6% 1.01x
Integrate 649 642 -1.1% 1.01x (?)
IterateData 12646 12473 -1.4% 1.01x
Join 1429 1414 -1.0% 1.01x
LazilyFilteredArrayContains 976206 929874 -4.7% 1.05x
LazilyFilteredArrays 1646405 1666762 +1.2% 0.99x (?)
LazilyFilteredRange 671398 672875 +0.2% 1.00x (?)
LessSubstringSubstring 747 745 -0.3% 1.00x (?)
LessSubstringSubstringGenericComparable 414 413 -0.2% 1.00x
LinkedList 37880 38022 +0.4% 1.00x
MapReduce 36511 36330 -0.5% 1.00x
MapReduceAnyCollection 36878 36553 -0.9% 1.01x (?)
MapReduceAnyCollectionShort 48557 48166 -0.8% 1.01x (?)
MapReduceClass 41522 41547 +0.1% 1.00x (?)
MapReduceClassShort 52084 51685 -0.8% 1.01x (?)
MapReduceLazyCollection 33695 32199 -4.4% 1.05x
MapReduceLazyCollectionShort 43660 41720 -4.4% 1.05x
MapReduceSequence 42640 41993 -1.5% 1.02x
MapReduceShort 48107 47999 -0.2% 1.00x (?)
MapReduceShortString 268 267 -0.4% 1.00x (?)
MapReduceString 2556 2549 -0.3% 1.00x (?)
Memset 44620 44634 +0.0% 1.00x (?)
MonteCarloE 910362 922419 +1.3% 0.99x
MonteCarloPi 3918529 3991535 +1.9% 0.98x
NSDictionaryCastToSwift 6104 6002 -1.7% 1.02x (?)
NSError 685 683 -0.3% 1.00x (?)
NopDeinit 160843 163792 +1.8% 0.98x
ObjectAllocation 1379 1374 -0.4% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 6423 6446 +0.4% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 38632 37152 -3.8% 1.04x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 32317 32360 +0.1% 1.00x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 115720 112894 -2.4% 1.03x (?)
ObjectiveCBridgeFromNSSetAnyObject 65106 64201 -1.4% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 6991 6729 -3.7% 1.04x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 69465 66640 -4.1% 1.04x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 69137 66021 -4.5% 1.05x (?)
ObjectiveCBridgeFromNSStringForced 2081 2131 +2.4% 0.98x (?)
ObjectiveCBridgeStubDataAppend 4313 4438 +2.9% 0.97x (?)
ObjectiveCBridgeStubDateAccess 1163 1160 -0.3% 1.00x
ObjectiveCBridgeStubDateMutation 630 611 -3.0% 1.03x
ObjectiveCBridgeStubFromArrayOfNSString 23511 23443 -0.3% 1.00x (?)
ObjectiveCBridgeStubFromNSDate 3888 4038 +3.9% 0.96x
ObjectiveCBridgeStubFromNSDateRef 4396 4418 +0.5% 1.00x (?)
ObjectiveCBridgeStubFromNSString 558 554 -0.7% 1.01x (?)
ObjectiveCBridgeStubFromNSStringRef 186 189 +1.6% 0.98x
ObjectiveCBridgeStubNSDataAppend 2846 2720 -4.4% 1.05x
ObjectiveCBridgeStubNSDateMutationRef 14803 15164 +2.4% 0.98x (?)
ObjectiveCBridgeStubNSDateRefAccess 1450 1450 +0.0% 1.00x
ObjectiveCBridgeStubToArrayOfNSString 27707 27300 -1.5% 1.01x (?)
ObjectiveCBridgeStubToNSDate 14457 14815 +2.5% 0.98x (?)
ObjectiveCBridgeStubToNSDateRef 3315 3328 +0.4% 1.00x (?)
ObjectiveCBridgeStubToNSString 1458 1461 +0.2% 1.00x (?)
ObjectiveCBridgeStubToNSStringRef 157 161 +2.5% 0.98x
ObjectiveCBridgeStubURLAppendPath 206435 209747 +1.6% 0.98x (?)
ObjectiveCBridgeStubURLAppendPathRef 205069 208632 +1.7% 0.98x (?)
ObjectiveCBridgeToNSArray 27883 27589 -1.1% 1.01x
ObjectiveCBridgeToNSDictionary 44472 42972 -3.4% 1.03x (?)
ObjectiveCBridgeToNSSet 37712 37831 +0.3% 1.00x (?)
ObjectiveCBridgeToNSString 1253 1250 -0.2% 1.00x (?)
ObserverClosure 6569 6565 -0.1% 1.00x (?)
ObserverForwarderStruct 4804 4762 -0.9% 1.01x (?)
ObserverPartiallyAppliedMethod 7946 7928 -0.2% 1.00x (?)
ObserverUnappliedMethod 8404 8477 +0.9% 0.99x (?)
Phonebook 20320 20110 -1.0% 1.01x (?)
PolymorphicCalls 4935 4916 -0.4% 1.00x (?)
PopFrontArray 9689 9664 -0.3% 1.00x (?)
PopFrontArrayGeneric 8859 8589 -3.0% 1.03x
PrefixAnyCollection 19186 19223 +0.2% 1.00x (?)
PrefixAnyCollectionLazy 133334 130325 -2.3% 1.02x (?)
PrefixAnySeqCRangeIter 22969 22824 -0.6% 1.01x (?)
PrefixAnySeqCRangeIterLazy 22956 22868 -0.4% 1.00x (?)
PrefixAnySeqCntRange 19198 19225 +0.1% 1.00x (?)
PrefixAnySeqCntRangeLazy 19504 19197 -1.6% 1.02x (?)
PrefixArray 6033 5839 -3.2% 1.03x
PrefixArrayLazy 41963 42114 +0.4% 1.00x (?)
PrefixCountableRange 445 443 -0.4% 1.00x
PrefixCountableRangeLazy 38059 38074 +0.0% 1.00x (?)
PrefixWhileAnyCollection 36769 36935 +0.5% 1.00x (?)
PrefixWhileAnyCollectionLazy 22186 22177 -0.0% 1.00x (?)
PrefixWhileAnySeqCRangeIter 40390 40361 -0.1% 1.00x (?)
PrefixWhileAnySeqCRangeIterLazy 22151 21970 -0.8% 1.01x (?)
PrefixWhileAnySeqCntRange 36697 36802 +0.3% 1.00x (?)
PrefixWhileAnySeqCntRangeLazy 22234 22239 +0.0% 1.00x (?)
PrefixWhileAnySequence 30776 30212 -1.8% 1.02x
PrefixWhileArray 16282 16181 -0.6% 1.01x
PrefixWhileArrayLazy 14563 14209 -2.4% 1.02x
PrefixWhileCountableRange 18031 17908 -0.7% 1.01x
PrefixWhileCountableRangeLazy 21783 21322 -2.1% 1.02x
PrefixWhileSequence 29830 29055 -2.6% 1.03x
Prims 10041 9755 -2.8% 1.03x
PrimsSplit 10030 9766 -2.6% 1.03x (?)
ProtocolDispatch 7148 7435 +4.0% 0.96x
ProtocolDispatch2 469 469 +0.0% 1.00x
RC4 17834 17589 -1.4% 1.01x
RGBHistogramOfObjects 100128 99023 -1.1% 1.01x
RangeAssignment 5398 5376 -0.4% 1.00x
RangeIterationSigned 16964 16685 -1.6% 1.02x
RangeIterationSigned64 49703 49009 -1.4% 1.01x
RangeIterationUnsigned 45247 44377 -1.9% 1.02x (?)
RecursiveOwnedParameter 10460 10456 -0.0% 1.00x (?)
ReversedArray 41408 41308 -0.2% 1.00x (?)
ReversedBidirectional 70805 69434 -1.9% 1.02x
ReversedDictionary 27171 27212 +0.2% 1.00x (?)
SetExclusiveOr_OfObjects 45348 44187 -2.6% 1.03x
SetUnion 11208 11156 -0.5% 1.00x (?)
SetUnion_OfObjects 31674 31800 +0.4% 1.00x (?)
SevenBoom 1584 1518 -4.2% 1.04x (?)
Sim2DArray 42629 42642 +0.0% 1.00x (?)
SortLargeExistentials 16460 16401 -0.4% 1.00x (?)
SortLettersInPlace 2887 2874 -0.5% 1.00x
SortSortedStrings 1369 1371 +0.1% 1.00x (?)
SortStrings 2466 2475 +0.4% 1.00x (?)
SortStringsUnicode 8624 8603 -0.2% 1.00x
StaticArray 4310 4472 +3.8% 0.96x
StrComplexWalk 6582 6577 -0.1% 1.00x (?)
StringAdder 3615 3593 -0.6% 1.01x
StringBuilder 6803 6601 -3.0% 1.03x
StringBuilderLong 1109 1108 -0.1% 1.00x (?)
StringEdits 358407 357373 -0.3% 1.00x (?)
StringEnumRawValueInitialization 12188 11984 -1.7% 1.02x
StringEqualPointerComparison 2446 2533 +3.6% 0.97x
StringFromLongWholeSubstring 199 196 -1.5% 1.02x
StringFromLongWholeSubstringGeneric 205 209 +2.0% 0.98x (?)
StringHasPrefix 1773 1827 +3.0% 0.97x
StringHasPrefixUnicode 15967 15716 -1.6% 1.02x
StringHasSuffixUnicode 60019 60167 +0.2% 1.00x
StringInterpolation 12877 12835 -0.3% 1.00x (?)
StringMatch 32780 32263 -1.6% 1.02x
StringUTF16Builder 7596 7423 -2.3% 1.02x
StringWalk 11196 11675 +4.3% 0.96x
StringWithCString 54336 54069 -0.5% 1.00x
SubstringComparable 4066 4000 -1.6% 1.02x
SubstringEqualString 6173 6165 -0.1% 1.00x (?)
SubstringEquatable 8043 7840 -2.5% 1.03x (?)
SubstringFromLongString 16 16 +0.0% 1.00x
SubstringFromLongStringGeneric 106 105 -0.9% 1.01x
SuffixAnyCollection 6408 6419 +0.2% 1.00x
SuffixAnyCollectionLazy 44597 43652 -2.1% 1.02x (?)
SuffixAnySeqCRangeIter 42267 41661 -1.4% 1.01x
SuffixAnySeqCRangeIterLazy 41984 41804 -0.4% 1.00x
SuffixAnySeqCntRange 6409 6405 -0.1% 1.00x (?)
SuffixAnySeqCntRangeLazy 6530 6366 -2.5% 1.03x
SuffixAnySequence 29367 28543 -2.8% 1.03x
SuffixAnySequenceLazy 29464 28517 -3.2% 1.03x
SuffixArray 2018 1951 -3.3% 1.03x
SuffixArrayLazy 13991 14024 +0.2% 1.00x (?)
SuffixCountableRange 154 153 -0.6% 1.01x
SuffixCountableRangeLazy 12770 12684 -0.7% 1.01x (?)
SuffixSequence 29064 28243 -2.8% 1.03x
SuffixSequenceLazy 29396 28622 -2.6% 1.03x
SumUsingReduce 216684 215815 -0.4% 1.00x (?)
SumUsingReduceInto 213329 212794 -0.3% 1.00x
SuperChars 181120 179882 -0.7% 1.01x (?)
TypeFlood 153 160 +4.6% 0.96x (?)
UTF8Decode 36053 35775 -0.8% 1.01x
Walsh 11814 11822 +0.1% 1.00x (?)
XorLoop 23234 23229 -0.0% 1.00x (?)
Hardware Overview
  Model Name: Mac mini
  Model Identifier: Macmini7,1
  Processor Name: Intel Core i7
  Processor Speed: 3 GHz
  Number of Processors: 1
  Total Number of Cores: 2
  L2 Cache (per Core): 256 KB
  L3 Cache: 4 MB
  Memory: 16 GB

@aschwaighofer
Copy link
Contributor Author

@slavapestov They are also used for non-fixed size structs and enums. Where the enums are the hairy part. structs currently follow the same rule as tuples (first field's extra inhabitants).

  • Singleton enums have the extra inhabitant count of the singleton payload or 0 if the singleton is empty.
    This can follow the scheme for structs/tuples:
if (hasPayload)
  PayloadT->getEnumTagSinglePayload
  • NoPayload enums have the number of all values above their greatest discriminator value that fit inside their storage size.
    Not dependent on a T. Continues to work.

  • SinglePayloadEnums reuse their payload's extra inhabitants minus the number of tags they need for their own discriminator.
    I believe that we would have to give up on reusing the payload's extra inhabitants.

  • MultiPayloadEnums don't currently provide extra inhabitants

If we are okay to loose the single payload enums extra inhabitants I believe the scheme would work.

A further complication is that now the enum witnesses would have to be described in terms of an abstract size such that we can find the address of the extra tag bytes when we forward to the payload of an enum/first element of a struct/tuple . This is doable (see below) but means that the witnesses of fixed size types will no longer simplify as well because the size is dynamic.

The witnesses would get an additional argument that is the size of the 'outermost' type that we append any potential .

getEnumTagSinglePayload(const T *enum, UINT_TYPE emptyCases, const Metatype * self)

would become

getEnumTagSinglePayload(const T *enum, UINT_TYPE emptyCases, const Metatype * self,const Metatype * outermostType)

We pass null at the top-level of witness calls. So fixed size types will still use the static size in the common case.

Hand-wavy sketch for a fixed size type:

int getEnumTagSinglePayload(const T *enum, UINT_TYPE emptyCases, const Metatype * self,const Metatype * outermostType) {
   auto size = #FixedSize
   if (outermostType)
      size = outermostType->size()
}

The witness for a tuple will look like:

int getEnumTagSinglePayload(const T *enum, UINT_TYPE emptyCases, const Metatype * self,const Metatype * typeForSize) {
   auto &metatype = *(const TupleTypeMetadata*) self;
   auto &firstEltTy = metatype.getElement(0).Type;
   firstEltTy->vw_getEnumTagSinglePayload(enum, emptyCases, firstEltTy, self)
}

What does that mean for code size: We have the cost of passing an extra zero at all call-sites plus bigger witness implementations for fixed size types because the size is dynamic. Not immediately clear that this is a code size win. You only pay for extra inhabitant witnesses if there are extra inhabitants.

@slavapestov
Copy link
Contributor

Ok, we can stick with the current approach then.

Conditionally (on Osize) outline the witness call - this saves two loads
@aschwaighofer
Copy link
Contributor Author

The standard library text size increases by 0.9% on x86-64. From 4254426 to 4292298 bytes.

Out of the 37K bytes, 21K bytes are from the witnesses, the rest is overhead because we now have to load the witness on the caller side.

@aschwaighofer
Copy link
Contributor Author

(Numbers on arm are similar)

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please smoke test mac os x

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c538077

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - c538077

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test linux

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (10)
TEST OLD NEW DELTA SPEEDUP
SuffixArrayLazy 7 8 +14.3% 0.88x
ProtocolDispatch 2727 3030 +11.1% 0.90x
MapReduceAnyCollection 362 392 +8.3% 0.92x
ProtocolDispatch2 127 137 +7.9% 0.93x
LazilyFilteredArrayContains 17017 18298 +7.5% 0.93x
ArraySetElement 425 455 +7.1% 0.93x
StringWithCString 62674 67047 +7.0% 0.93x (?)
RangeAssignment 339 361 +6.5% 0.94x
DropLastSequenceLazy 614 650 +5.9% 0.94x
DropLastSequence 615 648 +5.4% 0.95x
Improvement (8)
TEST OLD NEW DELTA SPEEDUP
DropWhileAnySequence 7526 6109 -18.8% 1.23x
PopFrontUnsafePointer 6092 5249 -13.8% 1.16x (?)
ObjectiveCBridgeStubNSDateRefAccess 371 338 -8.9% 1.10x
DropFirstAnySequence 6515 6083 -6.6% 1.07x
PopFrontArray 1279 1202 -6.0% 1.06x (?)
ArrayAppendLatin1 43446 41070 -5.5% 1.06x (?)
ObjectiveCBridgeFromNSArrayAnyObject 22466 21244 -5.4% 1.06x
PrefixAnySequenceLazy 5500 5232 -4.9% 1.05x
No Changes (316)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 2946 2951 +0.2% 1.00x (?)
AnyHashableWithAClass 67239 67700 +0.7% 0.99x (?)
Array2D 1881 1893 +0.6% 0.99x (?)
ArrayAppend 1066 1064 -0.2% 1.00x (?)
ArrayAppendArrayOfInt 598 598 +0.0% 1.00x
ArrayAppendAscii 18948 19285 +1.8% 0.98x (?)
ArrayAppendFromGeneric 596 599 +0.5% 0.99x (?)
ArrayAppendGenericStructs 1220 1218 -0.2% 1.00x (?)
ArrayAppendLazyMap 923 924 +0.1% 1.00x (?)
ArrayAppendOptionals 1213 1223 +0.8% 0.99x (?)
ArrayAppendRepeatCol 998 998 +0.0% 1.00x
ArrayAppendReserved 826 827 +0.1% 1.00x (?)
ArrayAppendSequence 972 996 +2.5% 0.98x
ArrayAppendStrings 15086 15110 +0.2% 1.00x (?)
ArrayAppendToFromGeneric 598 599 +0.2% 1.00x (?)
ArrayAppendToGeneric 598 598 +0.0% 1.00x
ArrayAppendUTF16 41180 41166 -0.0% 1.00x (?)
ArrayInClass 62 62 +0.0% 1.00x
ArrayLiteral 0 0 +0.0% 1.00x
ArrayOfGenericPOD 219 219 +0.0% 1.00x
ArrayOfGenericRef 3960 3971 +0.3% 1.00x (?)
ArrayOfPOD 165 165 +0.0% 1.00x
ArrayOfRef 3893 3900 +0.2% 1.00x (?)
ArrayPlusEqualArrayOfInt 597 598 +0.2% 1.00x (?)
ArrayPlusEqualFiveElementCollection 4814 4823 +0.2% 1.00x (?)
ArrayPlusEqualSingleElementCollection 1066 1063 -0.3% 1.00x (?)
ArrayPlusEqualThreeElements 1619 1623 +0.2% 1.00x (?)
ArraySubscript 1496 1506 +0.7% 0.99x (?)
ArrayValueProp 6 6 +0.0% 1.00x
ArrayValueProp2 6 6 +0.0% 1.00x
ArrayValueProp3 6 6 +0.0% 1.00x
ArrayValueProp4 6 6 +0.0% 1.00x
BitCount 147 144 -2.0% 1.02x (?)
ByteSwap 116 115 -0.9% 1.01x (?)
CStringLongAscii 4895 4888 -0.1% 1.00x (?)
CStringLongNonAscii 2269 2257 -0.5% 1.01x (?)
CStringShortAscii 4795 4859 +1.3% 0.99x
Calculator 35 34 -2.9% 1.03x (?)
CaptureProp 4600 4429 -3.7% 1.04x (?)
CharIndexing_ascii_unicodeScalars 13446 13448 +0.0% 1.00x (?)
CharIndexing_ascii_unicodeScalars_Backwards 11261 11259 -0.0% 1.00x (?)
CharIndexing_chinese_unicodeScalars 10193 10200 +0.1% 1.00x (?)
CharIndexing_chinese_unicodeScalars_Backwards 8549 8557 +0.1% 1.00x
CharIndexing_japanese_unicodeScalars 16083 16073 -0.1% 1.00x (?)
CharIndexing_japanese_unicodeScalars_Backwards 13464 13470 +0.0% 1.00x (?)
CharIndexing_korean_unicodeScalars 13037 13043 +0.0% 1.00x (?)
CharIndexing_korean_unicodeScalars_Backwards 10917 10922 +0.0% 1.00x (?)
CharIndexing_punctuatedJapanese_unicodeScalars 2475 2488 +0.5% 0.99x (?)
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 2093 2105 +0.6% 0.99x
CharIndexing_punctuated_unicodeScalars 3090 3090 +0.0% 1.00x
CharIndexing_punctuated_unicodeScalars_Backwards 2605 2602 -0.1% 1.00x (?)
CharIndexing_russian_unicodeScalars 11209 11211 +0.0% 1.00x (?)
CharIndexing_russian_unicodeScalars_Backwards 9389 9391 +0.0% 1.00x (?)
CharIndexing_tweet_unicodeScalars 26493 26470 -0.1% 1.00x (?)
CharIndexing_tweet_unicodeScalars_Backwards 22171 22172 +0.0% 1.00x (?)
CharIndexing_utf16_unicodeScalars 80921 81001 +0.1% 1.00x (?)
CharIndexing_utf16_unicodeScalars_Backwards 60401 60384 -0.0% 1.00x (?)
CharIteration_ascii_unicodeScalars 15224 15448 +1.5% 0.99x
CharIteration_ascii_unicodeScalars_Backwards 16570 16575 +0.0% 1.00x (?)
CharIteration_chinese_unicodeScalars 11540 11719 +1.6% 0.98x
CharIteration_chinese_unicodeScalars_Backwards 12544 12545 +0.0% 1.00x (?)
CharIteration_japanese_unicodeScalars 18228 18471 +1.3% 0.99x
CharIteration_japanese_unicodeScalars_Backwards 19840 19850 +0.1% 1.00x (?)
CharIteration_korean_unicodeScalars 14769 14984 +1.5% 0.99x (?)
CharIteration_korean_unicodeScalars_Backwards 16067 16067 +0.0% 1.00x
CharIteration_punctuatedJapanese_unicodeScalars 2769 2818 +1.8% 0.98x
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 2985 2994 +0.3% 1.00x
CharIteration_punctuated_unicodeScalars 3462 3536 +2.1% 0.98x
CharIteration_punctuated_unicodeScalars_Backwards 3740 3743 +0.1% 1.00x (?)
CharIteration_russian_unicodeScalars 12691 12868 +1.4% 0.99x
CharIteration_russian_unicodeScalars_Backwards 13805 13810 +0.0% 1.00x (?)
CharIteration_tweet_unicodeScalars 30000 30428 +1.4% 0.99x
CharIteration_tweet_unicodeScalars_Backwards 32775 32760 -0.0% 1.00x (?)
CharIteration_utf16_unicodeScalars 78449 79682 +1.6% 0.98x (?)
CharIteration_utf16_unicodeScalars_Backwards 97618 97815 +0.2% 1.00x (?)
CharacterLiteralsLarge 5949 5956 +0.1% 1.00x (?)
CharacterLiteralsSmall 403 404 +0.2% 1.00x
Chars 629 622 -1.1% 1.01x (?)
ClassArrayGetter 13 13 +0.0% 1.00x
DeadArray 184 181 -1.6% 1.02x
Dictionary 572 569 -0.5% 1.01x (?)
Dictionary2 1837 1832 -0.3% 1.00x (?)
Dictionary2OfObjects 3190 3198 +0.3% 1.00x (?)
Dictionary3 468 467 -0.2% 1.00x (?)
Dictionary3OfObjects 829 833 +0.5% 1.00x (?)
DictionaryBridge 2588 2535 -2.0% 1.02x (?)
DictionaryGroup 274 274 +0.0% 1.00x
DictionaryGroupOfObjects 1793 1793 +0.0% 1.00x
DictionaryLiteral 1467 1465 -0.1% 1.00x (?)
DictionaryOfObjects 2207 2200 -0.3% 1.00x (?)
DictionaryRemove 2491 2447 -1.8% 1.02x (?)
DictionaryRemoveOfObjects 22931 22837 -0.4% 1.00x (?)
DictionarySwap 417 414 -0.7% 1.01x (?)
DictionarySwapOfObjects 7429 7454 +0.3% 1.00x (?)
DropFirstAnyCollection 55 55 +0.0% 1.00x
DropFirstAnyCollectionLazy 77757 76978 -1.0% 1.01x (?)
DropFirstAnySeqCRangeIter 28283 28161 -0.4% 1.00x (?)
DropFirstAnySeqCRangeIterLazy 28294 28162 -0.5% 1.00x (?)
DropFirstAnySeqCntRange 50 50 +0.0% 1.00x
DropFirstAnySeqCntRangeLazy 50 50 +0.0% 1.00x
DropFirstAnySequenceLazy 6239 6068 -2.7% 1.03x
DropFirstArray 30 30 +0.0% 1.00x
DropFirstArrayLazy 30 30 +0.0% 1.00x
DropFirstCountableRange 18 18 +0.0% 1.00x
DropFirstCountableRangeLazy 18 18 +0.0% 1.00x
DropFirstSequence 2019 2019 +0.0% 1.00x
DropFirstSequenceLazy 1944 1944 +0.0% 1.00x
DropLastAnyCollection 21 21 +0.0% 1.00x
DropLastAnyCollectionLazy 25968 25731 -0.9% 1.01x (?)
DropLastAnySeqCRangeIter 4720 4691 -0.6% 1.01x (?)
DropLastAnySeqCRangeIterLazy 4747 4697 -1.1% 1.01x (?)
DropLastAnySeqCntRange 16 16 +0.0% 1.00x
DropLastAnySeqCntRangeLazy 16 16 +0.0% 1.00x
DropLastAnySequence 6727 6678 -0.7% 1.01x
DropLastAnySequenceLazy 6669 6632 -0.6% 1.01x
DropLastArray 7 7 +0.0% 1.00x
DropLastArrayLazy 7 7 +0.0% 1.00x
DropLastCountableRange 6 6 +0.0% 1.00x
DropLastCountableRangeLazy 6 6 +0.0% 1.00x
DropWhileAnyCollection 68 68 +0.0% 1.00x
DropWhileAnyCollectionLazy 89 90 +1.1% 0.99x
DropWhileAnySeqCRangeIter 22737 22266 -2.1% 1.02x (?)
DropWhileAnySeqCRangeIterLazy 90 89 -1.1% 1.01x
DropWhileAnySeqCntRange 63 63 +0.0% 1.00x
DropWhileAnySeqCntRangeLazy 90 89 -1.1% 1.01x
DropWhileAnySequenceLazy 1932 1933 +0.1% 1.00x (?)
DropWhileArray 43 43 +0.0% 1.00x
DropWhileArrayLazy 78 82 +5.1% 0.95x
DropWhileCountableRange 19 19 +0.0% 1.00x
DropWhileCountableRangeLazy 70 70 +0.0% 1.00x
DropWhileSequence 1623 1591 -2.0% 1.02x
DropWhileSequenceLazy 47 46 -2.1% 1.02x (?)
EqualStringSubstring 392 389 -0.8% 1.01x
EqualSubstringString 390 390 +0.0% 1.00x
EqualSubstringSubstring 389 390 +0.3% 1.00x (?)
EqualSubstringSubstringGenericEquatable 393 393 +0.0% 1.00x
ErrorHandling 2050 2066 +0.8% 0.99x (?)
ExclusivityGlobal 3 3 +0.0% 1.00x
ExclusivityInMatSet 18 18 +0.0% 1.00x
ExclusivityIndependent 2 2 +0.0% 1.00x
FilterEvenUsingReduce 1312 1300 -0.9% 1.01x (?)
FilterEvenUsingReduceInto 146 144 -1.4% 1.01x (?)
FrequenciesUsingReduce 7401 7423 +0.3% 1.00x (?)
FrequenciesUsingReduceInto 4135 4125 -0.2% 1.00x (?)
Hanoi 3621 3552 -1.9% 1.02x (?)
HashTest 1719 1717 -0.1% 1.00x (?)
Histogram 277 280 +1.1% 0.99x
Integrate 249 249 +0.0% 1.00x
IterateData 1376 1407 +2.3% 0.98x
Join 375 371 -1.1% 1.01x (?)
LazilyFilteredArrays 65840 65940 +0.2% 1.00x (?)
LazilyFilteredRange 3752 3750 -0.1% 1.00x (?)
LessSubstringSubstring 391 391 +0.0% 1.00x
LessSubstringSubstringGenericComparable 393 389 -1.0% 1.01x (?)
LinkedList 6959 6988 +0.4% 1.00x (?)
MapReduce 361 362 +0.3% 1.00x (?)
MapReduceAnyCollectionShort 2103 2145 +2.0% 0.98x
MapReduceClass 3063 3062 -0.0% 1.00x (?)
MapReduceClassShort 4597 4569 -0.6% 1.01x (?)
MapReduceLazyCollection 12 12 +0.0% 1.00x
MapReduceLazyCollectionShort 4 4 +0.0% 1.00x
MapReduceLazySequence 90 90 +0.0% 1.00x
MapReduceSequence 440 440 +0.0% 1.00x
MapReduceShort 2036 2068 +1.6% 0.98x
MapReduceShortString 21 22 +4.8% 0.95x
MapReduceString 103 99 -3.9% 1.04x
Memset 234 234 +0.0% 1.00x
MonteCarloE 10338 10385 +0.5% 1.00x (?)
MonteCarloPi 43941 43970 +0.1% 1.00x (?)
NSDictionaryCastToSwift 5325 5306 -0.4% 1.00x (?)
NSError 295 300 +1.7% 0.98x (?)
NSStringConversion 357 351 -1.7% 1.02x (?)
NopDeinit 21382 21391 +0.0% 1.00x (?)
ObjectAllocation 180 180 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObjectForced 3487 3447 -1.1% 1.01x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 38990 38512 -1.2% 1.01x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 33335 33333 -0.0% 1.00x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 123134 120354 -2.3% 1.02x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 5112 4927 -3.6% 1.04x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 90902 87766 -3.4% 1.04x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 102004 98019 -3.9% 1.04x (?)
ObjectiveCBridgeFromNSSetAnyObject 64194 63304 -1.4% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 4234 4260 +0.6% 0.99x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 66906 65063 -2.8% 1.03x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 69261 66185 -4.4% 1.05x (?)
ObjectiveCBridgeFromNSString 988 988 +0.0% 1.00x
ObjectiveCBridgeFromNSStringForced 1829 1834 +0.3% 1.00x (?)
ObjectiveCBridgeStubDataAppend 3924 3805 -3.0% 1.03x (?)
ObjectiveCBridgeStubDateAccess 181 181 +0.0% 1.00x
ObjectiveCBridgeStubDateMutation 272 272 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 24946 24417 -2.1% 1.02x (?)
ObjectiveCBridgeStubFromNSDate 3684 3860 +4.8% 0.95x
ObjectiveCBridgeStubFromNSDateRef 4246 4241 -0.1% 1.00x (?)
ObjectiveCBridgeStubFromNSString 546 542 -0.7% 1.01x (?)
ObjectiveCBridgeStubFromNSStringRef 149 149 +0.0% 1.00x
ObjectiveCBridgeStubNSDataAppend 2417 2393 -1.0% 1.01x (?)
ObjectiveCBridgeStubNSDateMutationRef 12666 12813 +1.2% 0.99x (?)
ObjectiveCBridgeStubToArrayOfNSString 28865 28356 -1.8% 1.02x (?)
ObjectiveCBridgeStubToNSDate 14596 14596 +0.0% 1.00x
ObjectiveCBridgeStubToNSDateRef 3334 3177 -4.7% 1.05x (?)
ObjectiveCBridgeStubToNSString 1488 1491 +0.2% 1.00x (?)
ObjectiveCBridgeStubToNSStringRef 117 116 -0.9% 1.01x (?)
ObjectiveCBridgeStubURLAppendPath 220977 222507 +0.7% 0.99x (?)
ObjectiveCBridgeStubURLAppendPathRef 218719 220396 +0.8% 0.99x (?)
ObjectiveCBridgeToNSArray 29007 28663 -1.2% 1.01x (?)
ObjectiveCBridgeToNSDictionary 46064 45520 -1.2% 1.01x (?)
ObjectiveCBridgeToNSSet 40319 39661 -1.6% 1.02x (?)
ObjectiveCBridgeToNSString 1270 1269 -0.1% 1.00x (?)
ObserverClosure 2317 2323 +0.3% 1.00x (?)
ObserverForwarderStruct 888 889 +0.1% 1.00x (?)
ObserverPartiallyAppliedMethod 3774 3784 +0.3% 1.00x (?)
ObserverUnappliedMethod 2436 2437 +0.0% 1.00x (?)
OpenClose 3 3 +0.0% 1.00x
Phonebook 6287 6122 -2.6% 1.03x
PolymorphicCalls 17 17 +0.0% 1.00x
PopFrontArrayGeneric 1285 1294 +0.7% 0.99x (?)
PrefixAnyCollection 55 55 +0.0% 1.00x
PrefixAnyCollectionLazy 77551 77504 -0.1% 1.00x (?)
PrefixAnySeqCRangeIter 22128 21917 -1.0% 1.01x (?)
PrefixAnySeqCRangeIterLazy 22117 21796 -1.5% 1.01x (?)
PrefixAnySeqCntRange 50 50 +0.0% 1.00x
PrefixAnySeqCntRangeLazy 50 50 +0.0% 1.00x
PrefixAnySequence 5412 5238 -3.2% 1.03x
PrefixArray 30 30 +0.0% 1.00x
PrefixArrayLazy 30 30 +0.0% 1.00x
PrefixCountableRange 18 18 +0.0% 1.00x
PrefixCountableRangeLazy 18 18 +0.0% 1.00x
PrefixSequence 1515 1515 +0.0% 1.00x
PrefixSequenceLazy 1459 1459 +0.0% 1.00x
PrefixWhileAnyCollection 93 92 -1.1% 1.01x
PrefixWhileAnyCollectionLazy 66 66 +0.0% 1.00x
PrefixWhileAnySeqCRangeIter 12887 12787 -0.8% 1.01x (?)
PrefixWhileAnySeqCRangeIterLazy 66 66 +0.0% 1.00x
PrefixWhileAnySeqCntRange 88 88 +0.0% 1.00x
PrefixWhileAnySeqCntRangeLazy 66 66 +0.0% 1.00x
PrefixWhileAnySequence 14336 14205 -0.9% 1.01x (?)
PrefixWhileAnySequenceLazy 1436 1436 +0.0% 1.00x
PrefixWhileArray 68 68 +0.0% 1.00x
PrefixWhileArrayLazy 37 37 +0.0% 1.00x
PrefixWhileCountableRange 29 29 +0.0% 1.00x
PrefixWhileCountableRangeLazy 18 18 +0.0% 1.00x
PrefixWhileSequence 363 360 -0.8% 1.01x (?)
PrefixWhileSequenceLazy 28 28 +0.0% 1.00x
Prims 748 776 +3.7% 0.96x (?)
PrimsSplit 764 772 +1.0% 0.99x (?)
RC4 170 170 +0.0% 1.00x
RGBHistogram 2196 2213 +0.8% 0.99x (?)
RGBHistogramOfObjects 23295 23283 -0.1% 1.00x (?)
RangeIterationSigned 134 135 +0.7% 0.99x (?)
RangeIterationSigned64 151 152 +0.7% 0.99x
RangeIterationUnsigned 151 152 +0.7% 0.99x (?)
RecursiveOwnedParameter 2316 2294 -0.9% 1.01x
ReversedArray 45 45 +0.0% 1.00x
ReversedBidirectional 29117 29072 -0.2% 1.00x (?)
ReversedDictionary 118 117 -0.8% 1.01x (?)
SetExclusiveOr 2831 2801 -1.1% 1.01x (?)
SetExclusiveOr_OfObjects 8301 8306 +0.1% 1.00x (?)
SetIntersect 271 271 +0.0% 1.00x
SetIntersect_OfObjects 1715 1722 +0.4% 1.00x (?)
SetIsSubsetOf 319 319 +0.0% 1.00x
SetIsSubsetOf_OfObjects 384 384 +0.0% 1.00x
SetUnion 2582 2527 -2.1% 1.02x (?)
SetUnion_OfObjects 6861 6848 -0.2% 1.00x (?)
SevenBoom 1514 1508 -0.4% 1.00x (?)
Sim2DArray 343 342 -0.3% 1.00x (?)
SortLargeExistentials 8277 8307 +0.4% 1.00x (?)
SortLettersInPlace 1139 1146 +0.6% 0.99x (?)
SortSortedStrings 909 892 -1.9% 1.02x (?)
SortStrings 1701 1697 -0.2% 1.00x (?)
SortStringsUnicode 8103 8334 +2.9% 0.97x (?)
StackPromo 22759 22703 -0.2% 1.00x (?)
StaticArray 5 5 +0.0% 1.00x
StrComplexWalk 1594 1654 +3.8% 0.96x
StrToInt 1860 1905 +2.4% 0.98x
StringAdder 3498 3505 +0.2% 1.00x (?)
StringBuilder 998 1028 +3.0% 0.97x (?)
StringBuilderLong 928 934 +0.6% 0.99x (?)
StringEdits 171263 170424 -0.5% 1.00x (?)
StringEnumRawValueInitialization 803 791 -1.5% 1.02x (?)
StringEqualPointerComparison 363 363 +0.0% 1.00x
StringFromLongWholeSubstring 172 175 +1.7% 0.98x (?)
StringFromLongWholeSubstringGeneric 86 86 +0.0% 1.00x
StringHasPrefix 9 9 +0.0% 1.00x
StringHasPrefixUnicode 15013 14570 -3.0% 1.03x
StringHasSuffix 9 9 +0.0% 1.00x
StringHasSuffixUnicode 61421 61080 -0.6% 1.01x
StringInterpolation 10710 10633 -0.7% 1.01x (?)
StringMatch 7753 7396 -4.6% 1.05x
StringUTF16Builder 1868 1875 +0.4% 1.00x (?)
StringWalk 1494 1494 +0.0% 1.00x
SubstringComparable 1617 1638 +1.3% 0.99x (?)
SubstringEqualString 1435 1465 +2.1% 0.98x (?)
SubstringEquatable 3697 3711 +0.4% 1.00x (?)
SubstringFromLongString 10 10 +0.0% 1.00x
SubstringFromLongStringGeneric 72 72 +0.0% 1.00x
SuffixAnyCollection 21 21 +0.0% 1.00x
SuffixAnyCollectionLazy 25981 25693 -1.1% 1.01x (?)
SuffixAnySeqCRangeIter 5048 4993 -1.1% 1.01x (?)
SuffixAnySeqCRangeIterLazy 5064 5023 -0.8% 1.01x (?)
SuffixAnySeqCntRange 16 16 +0.0% 1.00x
SuffixAnySeqCntRangeLazy 16 16 +0.0% 1.00x
SuffixAnySequence 6718 6662 -0.8% 1.01x
SuffixAnySequenceLazy 6733 6653 -1.2% 1.01x
SuffixArray 7 7 +0.0% 1.00x
SuffixCountableRange 6 6 +0.0% 1.00x
SuffixCountableRangeLazy 6 6 +0.0% 1.00x
SuffixSequence 4653 4588 -1.4% 1.01x
SuffixSequenceLazy 4651 4588 -1.4% 1.01x
SumUsingReduce 97 97 +0.0% 1.00x
SumUsingReduceInto 97 97 +0.0% 1.00x
SuperChars 85526 85370 -0.2% 1.00x (?)
TwoSum 942 953 +1.2% 0.99x
TypeFlood 0 0 +0.0% 1.00x
UTF8Decode 257 257 +0.0% 1.00x
Walsh 376 376 +0.0% 1.00x
XorLoop 345 345 +0.0% 1.00x

Unoptimized (Onone)

Regression (6)
TEST OLD NEW DELTA SPEEDUP
ArrayOfPOD 712 792 +11.2% 0.90x
ExclusivityGlobal 172 188 +9.3% 0.91x
ArrayOfGenericPOD 1293 1382 +6.9% 0.94x
ObjectiveCBridgeStubFromNSDate 4113 4384 +6.6% 0.94x
StringEqualPointerComparison 2586 2756 +6.6% 0.94x
Calculator 1097 1158 +5.6% 0.95x
Improvement (51)
TEST OLD NEW DELTA SPEEDUP
SetIntersect 12593 8176 -35.1% 1.54x
SetIsSubsetOf 1906 1371 -28.1% 1.39x
StrToInt 127105 98890 -22.2% 1.29x
SetExclusiveOr 23034 18489 -19.7% 1.25x
DropWhileSequence 17717 15591 -12.0% 1.14x
DropWhileAnySequence 18722 16689 -10.9% 1.12x
TwoSum 4342 3877 -10.7% 1.12x
SetIntersect_OfObjects 12554 11376 -9.4% 1.10x
ObjectiveCBridgeFromNSString 3969 3603 -9.2% 1.10x
StringHasPrefix 2105 1913 -9.1% 1.10x
SetIsSubsetOf_OfObjects 1597 1458 -8.7% 1.10x
CharIndexing_chinese_unicodeScalars 380432 350840 -7.8% 1.08x
Histogram 9005 8319 -7.6% 1.08x
StringHasSuffix 2111 1955 -7.4% 1.08x
PrefixWhileSequenceLazy 12571 11646 -7.4% 1.08x
CharIndexing_korean_unicodeScalars 486261 450696 -7.3% 1.08x
ArrayAppendUTF16 77723 72317 -7.0% 1.07x
CharIndexing_japanese_unicodeScalars 600074 558578 -6.9% 1.07x
DropWhileAnySequenceLazy 15239 14206 -6.8% 1.07x
CharIndexing_ascii_unicodeScalars 498216 464774 -6.7% 1.07x
DropWhileSequenceLazy 13792 12872 -6.7% 1.07x
MapReduceLazySequence 30511 28502 -6.6% 1.07x
CharIndexing_russian_unicodeScalars 414226 387005 -6.6% 1.07x
CharIndexing_punctuated_unicodeScalars 108711 101724 -6.4% 1.07x
CaptureProp 125183 117153 -6.4% 1.07x
PrefixAnySequenceLazy 13014 12198 -6.3% 1.07x
CharIndexing_tweet_unicodeScalars 988131 929596 -5.9% 1.06x
PrefixAnySequence 12997 12233 -5.9% 1.06x
DropFirstSequence 14702 13863 -5.7% 1.06x
PrefixSequenceLazy 11878 11208 -5.6% 1.06x
ArrayAppendLatin1 76858 72553 -5.6% 1.06x
ObjectiveCBridgeFromNSDictionaryAnyObject 131714 124342 -5.6% 1.06x
Dictionary2 3470 3276 -5.6% 1.06x
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 57611 54404 -5.6% 1.06x
PrefixWhileAnySequenceLazy 13374 12636 -5.5% 1.06x
ObjectiveCBridgeFromNSArrayAnyObject 25073 23695 -5.5% 1.06x
PrefixSequence 11850 11202 -5.5% 1.06x
ObjectiveCBridgeStubToArrayOfNSString 29427 27832 -5.4% 1.06x
DropFirstSequenceLazy 14682 13910 -5.3% 1.06x
PrefixArray 6489 6150 -5.2% 1.06x
CharIndexing_russian_unicodeScalars_Backwards 449259 425822 -5.2% 1.06x
CharIndexing_chinese_unicodeScalars_Backwards 407643 386956 -5.1% 1.05x
CharIndexing_ascii_unicodeScalars_Backwards 545779 518210 -5.1% 1.05x
DropFirstAnySequenceLazy 15885 15104 -4.9% 1.05x
CharIndexing_japanese_unicodeScalars_Backwards 646820 615083 -4.9% 1.05x
CharIndexing_tweet_unicodeScalars_Backwards 1069655 1017298 -4.9% 1.05x
CharIndexing_punctuated_unicodeScalars_Backwards 118729 112947 -4.9% 1.05x
ObjectiveCBridgeStubToNSDateRef 3580 3407 -4.8% 1.05x (?)
CharIteration_russian_unicodeScalars_Backwards 274546 261369 -4.8% 1.05x
CharIteration_korean_unicodeScalars_Backwards 317742 302530 -4.8% 1.05x
CharIteration_japanese_unicodeScalars_Backwards 392262 373522 -4.8% 1.05x
No Changes (277)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 4988 4940 -1.0% 1.01x (?)
AnyHashableWithAClass 84494 85748 +1.5% 0.99x
Array2D 650376 649470 -0.1% 1.00x
ArrayAppend 4788 4880 +1.9% 0.98x
ArrayAppendArrayOfInt 655 655 +0.0% 1.00x
ArrayAppendAscii 53223 50710 -4.7% 1.05x
ArrayAppendFromGeneric 658 657 -0.2% 1.00x (?)
ArrayAppendGenericStructs 1287 1307 +1.6% 0.98x (?)
ArrayAppendLazyMap 228634 221461 -3.1% 1.03x
ArrayAppendOptionals 1298 1299 +0.1% 1.00x (?)
ArrayAppendRepeatCol 234652 227059 -3.2% 1.03x
ArrayAppendReserved 4519 4490 -0.6% 1.01x
ArrayAppendSequence 76257 72905 -4.4% 1.05x
ArrayAppendStrings 15216 15260 +0.3% 1.00x (?)
ArrayAppendToFromGeneric 657 658 +0.2% 1.00x (?)
ArrayAppendToGeneric 658 658 +0.0% 1.00x
ArrayInClass 6599 6521 -1.2% 1.01x
ArrayLiteral 1767 1753 -0.8% 1.01x (?)
ArrayOfGenericRef 10036 9971 -0.6% 1.01x
ArrayOfRef 9237 9209 -0.3% 1.00x (?)
ArrayPlusEqualArrayOfInt 655 655 +0.0% 1.00x
ArrayPlusEqualFiveElementCollection 306372 300885 -1.8% 1.02x (?)
ArrayPlusEqualSingleElementCollection 304488 298816 -1.9% 1.02x
ArrayPlusEqualThreeElements 10979 10803 -1.6% 1.02x
ArraySetElement 4788 4789 +0.0% 1.00x (?)
ArraySubscript 87644 88157 +0.6% 0.99x (?)
ArrayValueProp 3602 3603 +0.0% 1.00x (?)
ArrayValueProp2 18844 18350 -2.6% 1.03x
ArrayValueProp3 4246 4243 -0.1% 1.00x (?)
ArrayValueProp4 4233 4234 +0.0% 1.00x (?)
BitCount 1462 1520 +4.0% 0.96x
ByteSwap 4013 4142 +3.2% 0.97x
CStringLongAscii 4840 4917 +1.6% 0.98x
CStringLongNonAscii 2398 2420 +0.9% 0.99x (?)
CStringShortAscii 8902 8737 -1.9% 1.02x (?)
CharIndexing_korean_unicodeScalars_Backwards 519205 499391 -3.8% 1.04x
CharIndexing_punctuatedJapanese_unicodeScalars 84310 80468 -4.6% 1.05x
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 92396 88224 -4.5% 1.05x
CharIndexing_utf16_unicodeScalars 545892 524653 -3.9% 1.04x
CharIndexing_utf16_unicodeScalars_Backwards 582329 567402 -2.6% 1.03x
CharIteration_ascii_unicodeScalars 186094 181542 -2.4% 1.03x (?)
CharIteration_ascii_unicodeScalars_Backwards 327071 315894 -3.4% 1.04x
CharIteration_chinese_unicodeScalars 140230 136763 -2.5% 1.03x
CharIteration_chinese_unicodeScalars_Backwards 246408 235803 -4.3% 1.04x
CharIteration_japanese_unicodeScalars 221760 217272 -2.0% 1.02x
CharIteration_korean_unicodeScalars 179380 176124 -1.8% 1.02x
CharIteration_punctuatedJapanese_unicodeScalars 33043 32084 -2.9% 1.03x
CharIteration_punctuated_unicodeScalars 41496 40511 -2.4% 1.02x
CharIteration_punctuated_unicodeScalars_Backwards 71781 68475 -4.6% 1.05x (?)
CharIteration_russian_unicodeScalars 154761 150469 -2.8% 1.03x
CharIteration_tweet_unicodeScalars 367620 357948 -2.6% 1.03x
CharIteration_tweet_unicodeScalars_Backwards 647555 624428 -3.6% 1.04x
CharIteration_utf16_unicodeScalars 209707 205724 -1.9% 1.02x
CharIteration_utf16_unicodeScalars_Backwards 403771 391806 -3.0% 1.03x
CharacterLiteralsLarge 6188 6193 +0.1% 1.00x (?)
CharacterLiteralsSmall 706 693 -1.8% 1.02x
Chars 50765 49351 -2.8% 1.03x
ClassArrayGetter 1047 1046 -0.1% 1.00x
DeadArray 114371 113750 -0.5% 1.01x (?)
Dictionary 3035 3012 -0.8% 1.01x (?)
Dictionary2OfObjects 6049 5944 -1.7% 1.02x (?)
Dictionary3 1316 1312 -0.3% 1.00x (?)
Dictionary3OfObjects 2309 2294 -0.6% 1.01x (?)
DictionaryBridge 2689 2652 -1.4% 1.01x (?)
DictionaryGroup 5441 5377 -1.2% 1.01x
DictionaryGroupOfObjects 8320 8223 -1.2% 1.01x
DictionaryLiteral 8635 8624 -0.1% 1.00x (?)
DictionaryOfObjects 6566 6444 -1.9% 1.02x
DictionaryRemove 21664 21644 -0.1% 1.00x (?)
DictionaryRemoveOfObjects 59537 59766 +0.4% 1.00x (?)
DictionarySwap 5365 5148 -4.0% 1.04x
DictionarySwapOfObjects 23144 23047 -0.4% 1.00x (?)
DropFirstAnyCollection 20207 20475 +1.3% 0.99x (?)
DropFirstAnyCollectionLazy 140798 139122 -1.2% 1.01x (?)
DropFirstAnySeqCRangeIter 30780 30661 -0.4% 1.00x
DropFirstAnySeqCRangeIterLazy 30785 30537 -0.8% 1.01x
DropFirstAnySeqCntRange 20179 20432 +1.3% 0.99x
DropFirstAnySeqCntRangeLazy 20225 20364 +0.7% 0.99x (?)
DropFirstAnySequence 15792 15076 -4.5% 1.05x
DropFirstArray 6341 6133 -3.3% 1.03x
DropFirstArrayLazy 44527 44521 -0.0% 1.00x (?)
DropFirstCountableRange 472 469 -0.6% 1.01x
DropFirstCountableRangeLazy 41430 41183 -0.6% 1.01x (?)
DropLastAnyCollection 6760 6827 +1.0% 0.99x
DropLastAnyCollectionLazy 46630 46277 -0.8% 1.01x (?)
DropLastAnySeqCRangeIter 47489 46946 -1.1% 1.01x (?)
DropLastAnySeqCRangeIterLazy 47343 46908 -0.9% 1.01x (?)
DropLastAnySeqCntRange 6747 6804 +0.8% 0.99x
DropLastAnySeqCntRangeLazy 6816 6818 +0.0% 1.00x (?)
DropLastAnySequence 33621 32679 -2.8% 1.03x
DropLastAnySequenceLazy 33708 32638 -3.2% 1.03x
DropLastArray 2121 2058 -3.0% 1.03x
DropLastArrayLazy 14875 14850 -0.2% 1.00x (?)
DropLastCountableRange 163 162 -0.6% 1.01x (?)
DropLastCountableRangeLazy 13819 13764 -0.4% 1.00x
DropLastSequence 33373 32320 -3.2% 1.03x
DropLastSequenceLazy 33697 32635 -3.2% 1.03x
DropWhileAnyCollection 26452 26621 +0.6% 0.99x
DropWhileAnyCollectionLazy 29222 28627 -2.0% 1.02x (?)
DropWhileAnySeqCRangeIter 33214 32075 -3.4% 1.04x
DropWhileAnySeqCRangeIterLazy 29186 28889 -1.0% 1.01x (?)
DropWhileAnySeqCntRange 26604 26560 -0.2% 1.00x (?)
DropWhileAnySeqCntRangeLazy 29177 28593 -2.0% 1.02x
DropWhileArray 10251 9940 -3.0% 1.03x
DropWhileArrayLazy 17623 17126 -2.8% 1.03x
DropWhileCountableRange 6684 6694 +0.1% 1.00x (?)
DropWhileCountableRangeLazy 28348 27718 -2.2% 1.02x
EqualStringSubstring 673 677 +0.6% 0.99x (?)
EqualSubstringString 673 679 +0.9% 0.99x
EqualSubstringSubstring 790 793 +0.4% 1.00x (?)
EqualSubstringSubstringGenericEquatable 422 422 +0.0% 1.00x
ErrorHandling 6819 6706 -1.7% 1.02x (?)
ExclusivityInMatSet 305 308 +1.0% 0.99x
ExclusivityIndependent 125 125 +0.0% 1.00x
FilterEvenUsingReduce 4306 4258 -1.1% 1.01x (?)
FilterEvenUsingReduceInto 2531 2484 -1.9% 1.02x
FrequenciesUsingReduce 15865 15495 -2.3% 1.02x
FrequenciesUsingReduceInto 8835 8496 -3.8% 1.04x
Hanoi 18997 19033 +0.2% 1.00x (?)
HashTest 17695 17416 -1.6% 1.02x
Integrate 685 688 +0.4% 1.00x (?)
IterateData 13456 13625 +1.3% 0.99x
Join 1510 1512 +0.1% 1.00x (?)
LazilyFilteredArrayContains 997267 983604 -1.4% 1.01x
LazilyFilteredArrays 1745692 1736065 -0.6% 1.01x (?)
LazilyFilteredRange 715012 702975 -1.7% 1.02x (?)
LessSubstringSubstring 793 795 +0.3% 1.00x (?)
LessSubstringSubstringGenericComparable 439 438 -0.2% 1.00x
LinkedList 40082 40271 +0.5% 1.00x
MapReduce 38892 38701 -0.5% 1.00x
MapReduceAnyCollection 38714 39133 +1.1% 0.99x (?)
MapReduceAnyCollectionShort 51434 51542 +0.2% 1.00x (?)
MapReduceClass 44292 44319 +0.1% 1.00x (?)
MapReduceClassShort 54989 54835 -0.3% 1.00x (?)
MapReduceLazyCollection 34802 34049 -2.2% 1.02x
MapReduceLazyCollectionShort 45904 44430 -3.2% 1.03x
MapReduceSequence 45308 44522 -1.7% 1.02x
MapReduceShort 51049 50450 -1.2% 1.01x (?)
MapReduceShortString 289 279 -3.5% 1.04x
MapReduceString 2715 2683 -1.2% 1.01x (?)
Memset 47290 47278 -0.0% 1.00x
MonteCarloE 957768 958751 +0.1% 1.00x (?)
MonteCarloPi 4083863 4094517 +0.3% 1.00x (?)
NSDictionaryCastToSwift 6467 6226 -3.7% 1.04x (?)
NSError 729 725 -0.5% 1.01x (?)
NSStringConversion 396 396 +0.0% 1.00x
NopDeinit 169993 173548 +2.1% 0.98x
ObjectAllocation 1466 1444 -1.5% 1.02x (?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 6875 7121 +3.6% 0.97x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 41059 39791 -3.1% 1.03x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 35117 35013 -0.3% 1.00x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7420 7474 +0.7% 0.99x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 95749 92320 -3.6% 1.04x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 104032 103284 -0.7% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObject 68710 68014 -1.0% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 7332 7257 -1.0% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 73548 70577 -4.0% 1.04x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 75792 72271 -4.6% 1.05x (?)
ObjectiveCBridgeFromNSStringForced 2240 2246 +0.3% 1.00x (?)
ObjectiveCBridgeStubDataAppend 4651 4586 -1.4% 1.01x (?)
ObjectiveCBridgeStubDateAccess 1232 1229 -0.2% 1.00x
ObjectiveCBridgeStubDateMutation 667 645 -3.3% 1.03x
ObjectiveCBridgeStubFromArrayOfNSString 25204 25216 +0.0% 1.00x (?)
ObjectiveCBridgeStubFromNSDateRef 4672 4656 -0.3% 1.00x (?)
ObjectiveCBridgeStubFromNSString 592 595 +0.5% 0.99x (?)
ObjectiveCBridgeStubFromNSStringRef 198 198 +0.0% 1.00x
ObjectiveCBridgeStubNSDataAppend 2936 2874 -2.1% 1.02x (?)
ObjectiveCBridgeStubNSDateMutationRef 15895 15328 -3.6% 1.04x (?)
ObjectiveCBridgeStubNSDateRefAccess 1537 1537 +0.0% 1.00x
ObjectiveCBridgeStubToNSDate 14947 14724 -1.5% 1.02x (?)
ObjectiveCBridgeStubToNSString 1552 1558 +0.4% 1.00x (?)
ObjectiveCBridgeStubToNSStringRef 167 171 +2.4% 0.98x
ObjectiveCBridgeStubURLAppendPath 227687 225460 -1.0% 1.01x (?)
ObjectiveCBridgeStubURLAppendPathRef 226119 225761 -0.2% 1.00x (?)
ObjectiveCBridgeToNSArray 29353 29280 -0.2% 1.00x (?)
ObjectiveCBridgeToNSDictionary 46993 46551 -0.9% 1.01x (?)
ObjectiveCBridgeToNSSet 41746 40215 -3.7% 1.04x (?)
ObjectiveCBridgeToNSString 1328 1322 -0.5% 1.00x
ObserverClosure 6968 6950 -0.3% 1.00x (?)
ObserverForwarderStruct 5111 5073 -0.7% 1.01x
ObserverPartiallyAppliedMethod 8385 8382 -0.0% 1.00x (?)
ObserverUnappliedMethod 8954 8806 -1.7% 1.02x
OpenClose 392 392 +0.0% 1.00x
Phonebook 21175 21570 +1.9% 0.98x
PolymorphicCalls 5269 5212 -1.1% 1.01x
PopFrontArray 10234 10263 +0.3% 1.00x (?)
PopFrontArrayGeneric 9138 9205 +0.7% 0.99x (?)
PopFrontUnsafePointer 8095 8065 -0.4% 1.00x
PrefixAnyCollection 20220 20454 +1.2% 0.99x (?)
PrefixAnyCollectionLazy 139905 138540 -1.0% 1.01x (?)
PrefixAnySeqCRangeIter 24579 24202 -1.5% 1.02x
PrefixAnySeqCRangeIterLazy 24544 24124 -1.7% 1.02x (?)
PrefixAnySeqCntRange 20220 20356 +0.7% 0.99x
PrefixAnySeqCntRangeLazy 20218 20366 +0.7% 0.99x (?)
PrefixArrayLazy 44499 44500 +0.0% 1.00x (?)
PrefixCountableRange 472 469 -0.6% 1.01x
PrefixCountableRangeLazy 41384 41215 -0.4% 1.00x
PrefixWhileAnyCollection 39122 38916 -0.5% 1.01x
PrefixWhileAnyCollectionLazy 23872 23201 -2.8% 1.03x
PrefixWhileAnySeqCRangeIter 42891 42629 -0.6% 1.01x (?)
PrefixWhileAnySeqCRangeIterLazy 23924 23459 -1.9% 1.02x
PrefixWhileAnySeqCntRange 39050 39073 +0.1% 1.00x (?)
PrefixWhileAnySeqCntRangeLazy 23608 23317 -1.2% 1.01x (?)
PrefixWhileAnySequence 32799 31983 -2.5% 1.03x
PrefixWhileArray 17560 17274 -1.6% 1.02x
PrefixWhileArrayLazy 15372 15286 -0.6% 1.01x (?)
PrefixWhileCountableRange 19042 19019 -0.1% 1.00x
PrefixWhileCountableRangeLazy 23111 22621 -2.1% 1.02x
PrefixWhileSequence 31735 30892 -2.7% 1.03x
Prims 10581 10336 -2.3% 1.02x (?)
PrimsSplit 10599 10334 -2.5% 1.03x
ProtocolDispatch 7577 7880 +4.0% 0.96x
ProtocolDispatch2 496 497 +0.2% 1.00x
RC4 19539 19104 -2.2% 1.02x
RGBHistogram 34422 33101 -3.8% 1.04x
RGBHistogramOfObjects 105830 104751 -1.0% 1.01x (?)
RangeAssignment 5729 5730 +0.0% 1.00x (?)
RangeIterationSigned 18131 17854 -1.5% 1.02x
RangeIterationSigned64 52247 51462 -1.5% 1.02x
RangeIterationUnsigned 47643 46988 -1.4% 1.01x
RecursiveOwnedParameter 11086 11109 +0.2% 1.00x (?)
ReversedArray 44372 43831 -1.2% 1.01x (?)
ReversedBidirectional 75810 74096 -2.3% 1.02x
ReversedDictionary 29453 29212 -0.8% 1.01x
SetExclusiveOr_OfObjects 48359 46696 -3.4% 1.04x
SetUnion 12095 11919 -1.5% 1.01x
SetUnion_OfObjects 33794 33721 -0.2% 1.00x (?)
SevenBoom 1629 1667 +2.3% 0.98x (?)
Sim2DArray 45196 45188 -0.0% 1.00x (?)
SortLargeExistentials 17390 17574 +1.1% 0.99x (?)
SortLettersInPlace 3047 3052 +0.2% 1.00x (?)
SortSortedStrings 1450 1449 -0.1% 1.00x (?)
SortStrings 2576 2657 +3.1% 0.97x
SortStringsUnicode 9124 9265 +1.5% 0.98x
StackPromo 102964 101316 -1.6% 1.02x
StaticArray 4651 4552 -2.1% 1.02x
StrComplexWalk 6983 6999 +0.2% 1.00x (?)
StringAdder 3794 3783 -0.3% 1.00x (?)
StringBuilder 7147 7077 -1.0% 1.01x
StringBuilderLong 1161 1176 +1.3% 0.99x (?)
StringEdits 380628 379871 -0.2% 1.00x (?)
StringEnumRawValueInitialization 12766 12885 +0.9% 0.99x (?)
StringFromLongWholeSubstring 211 209 -0.9% 1.01x
StringFromLongWholeSubstringGeneric 215 217 +0.9% 0.99x (?)
StringHasPrefixUnicode 16805 16819 +0.1% 1.00x (?)
StringHasSuffixUnicode 63752 63774 +0.0% 1.00x (?)
StringInterpolation 13461 13427 -0.3% 1.00x (?)
StringMatch 34610 33401 -3.5% 1.04x (?)
StringUTF16Builder 7999 7803 -2.5% 1.03x (?)
StringWalk 12466 12078 -3.1% 1.03x
StringWithCString 57285 57992 +1.2% 0.99x (?)
SubstringComparable 4324 4274 -1.2% 1.01x
SubstringEqualString 6573 6597 +0.4% 1.00x (?)
SubstringEquatable 8397 8346 -0.6% 1.01x
SubstringFromLongString 17 17 +0.0% 1.00x
SubstringFromLongStringGeneric 112 112 +0.0% 1.00x
SuffixAnyCollection 6805 6821 +0.2% 1.00x
SuffixAnyCollectionLazy 47007 46375 -1.3% 1.01x (?)
SuffixAnySeqCRangeIter 44453 44205 -0.6% 1.01x (?)
SuffixAnySeqCRangeIterLazy 44419 44155 -0.6% 1.01x (?)
SuffixAnySeqCntRange 6749 6815 +1.0% 0.99x
SuffixAnySeqCntRangeLazy 6804 6817 +0.2% 1.00x
SuffixAnySequence 31146 30299 -2.7% 1.03x
SuffixAnySequenceLazy 31211 30310 -2.9% 1.03x
SuffixArray 2155 2070 -3.9% 1.04x
SuffixArrayLazy 14784 14848 +0.4% 1.00x (?)
SuffixCountableRange 163 162 -0.6% 1.01x
SuffixCountableRangeLazy 13811 13761 -0.4% 1.00x (?)
SuffixSequence 30836 29803 -3.3% 1.03x
SuffixSequenceLazy 30907 29971 -3.0% 1.03x
SumUsingReduce 229793 229815 +0.0% 1.00x (?)
SumUsingReduceInto 230027 228288 -0.8% 1.01x
SuperChars 193004 190733 -1.2% 1.01x
TypeFlood 169 167 -1.2% 1.01x (?)
UTF8Decode 38194 38175 -0.0% 1.00x (?)
Walsh 12507 12508 +0.0% 1.00x (?)
XorLoop 24621 24620 -0.0% 1.00x (?)
Hardware Overview
  Model Name: Mac mini
  Model Identifier: Macmini7,1
  Processor Name: Intel Core i5
  Processor Speed: 2.8 GHz
  Number of Processors: 1
  Total Number of Cores: 2
  L2 Cache (per Core): 256 KB
  L3 Cache: 3 MB
  Memory: 16 GB

@aschwaighofer
Copy link
Contributor Author

Code size swift-source-compat-suite. On interesting fact I noticed while looking at:

CleanroomLogger/watchos                    :     187695     193947   -3.33

that the delta (3.3%) could roughly be half that. There are duplicate value witnesses that llvm's merge function pass would merge. We run -wmo -num-threads 1..N and so these witnesses are split up per source file and don't get merged.

That is -wmo -num-threads >0 is not helpful for the merge function pass and we leave code size improvements on the table (not only for witnesses). This is the obvious trade-off of num-threads but had not occurred to me before.

Project/platform                           :        Old        New   Percent                                                                                                                                                               
                                                                                                                                                                                                                                           
Alamofire/iphoneos/arm64                   :     539932     545940   -1.11
Alamofire/iphoneos/armv7                   :     562731     568043   -0.94
iOS Example/iOS/arm64                      :      68452      68804   -0.51
iOS Example/iOS/armv7                      :      68454      68766   -0.46
Alamofire/iphoneos                         :    1102663    1113983   -1.03
Alamofire/iphoneos                         :    1102663    1113983   -1.03
iOS Example/iphoneos                       :     136906     137570   -0.49
AMScrollingNavbar/iphoneos/arm64           :      63452      63916   -0.73
AMScrollingNavbar/iphoneos/armv7           :      63054      63478   -0.67
AMScrollingNavbar/iphoneos                 :     126506     127394   -0.70
Socket/iphoneos/arm64                      :     105681     107893   -2.09
Socket/iphoneos/armv7                      :     120081     122081   -1.67
Socket/iphoneos                            :     225762     229974   -1.87
ChattoApp/iphoneos/arm64                   :     168833     169377   -0.32
ChattoApp/iphoneos/armv7                   :     175202     175738   -0.31           
Chatto/iphoneos/arm64                      :     274442     278230   -1.38
Chatto/iphoneos/armv7                      :     285867     289331   -1.21
ChattoAdditions/iphoneos/arm64             :     627469     635153   -1.22
ChattoAdditions/iphoneos/armv7             :     644250     651410   -1.11
Chatto/iphoneos                            :     560309     567561   -1.29
ChattoAdditions/iphoneos                   :    1271719    1286563   -1.17
ChattoApp/iphoneos                         :     344035     345115   -0.31
Chatto/iphoneos                            :     560309     567561   -1.29
ChattoAdditions/iphoneos                   :    1271719    1286563   -1.17
CleanroomLogger/watchos                    :     187695     193947   -3.33
Dollar/macos                               :     186168     188580   -1.30
Dwifft/iphoneos/arm64                      :     105665     106753   -1.03
Dwifft/iphoneos/armv7                      :     113710     114598   -0.78
Dwifft/iphoneos                            :     219375     221351   -0.90
IBAnimatable/iphoneos/arm64                :    1808681    1818465   -0.54
IBAnimatable/iphoneos/armv7                :    1856317    1865133   -0.47
IBAnimatableApp/iphoneos/arm64             :     210223     210715   -0.23
IBAnimatableApp/iphoneos/armv7             :     214435     214911   -0.22
IBAnimatable/iphoneos                      :    3664998    3683598   -0.51
IBAnimatable/iphoneos                      :    3664998    3683598   -0.51
IBAnimatableApp/iphoneos                   :     424658     425626   -0.23
JSQCoreDataKit/iphoneos/arm64              :      79874      81514   -2.05
JSQCoreDataKit/iphoneos/armv7              :      83412      84904   -1.79
JSQCoreDataKit/iphoneos                    :     163286     166418   -1.92
JSQDataSourcesKit/iphoneos/arm64           :     105441     106721   -1.21
JSQDataSourcesKit/iphoneos/armv7           :     102864     103856   -0.96
JSQDataSourcesKit/iphoneos                 :     208305     210577   -1.09
KeychainAccess/watchos                     :     201444     203676   -1.11
Prelude/appletvos                          :     112918     115514   -2.30
Prelude_UIKit/appletvos                    :     252654     256090   -1.36
ReactiveExtensions/appletvos               :     179366     179842   -0.27
ReactiveSwift/appletvos                    :     813594     820886   -0.90
Result/appletvos                           :      61346      61954   -0.99
Kingfisher/watchos                         :     266330     271030   -1.76
Kommander/watchos                          :      67136      67872   -1.10
LaunchScreenSnapshot/iphoneos/arm64        :      44892      45356   -1.03
LaunchScreenSnapshot/iphoneos/armv7        :      45056      45480   -0.94
LaunchScreenSnapshot/iphoneos              :      89948      90836   -0.99
ObjectMapper/watchos                       :     240815     242167   -0.56
Example/iphoneos/arm64                     :      29830      30022   -0.64
Example/iphoneos/armv7                     :      27051      27219   -0.62
PanelKit/iphoneos/arm64                    :     141982     143162   -0.83
PanelKit/iphoneos/armv7                    :     149354     150434   -0.72
Example/iphoneos                           :      56881      57241   -0.63
PanelKit/iphoneos                          :     291336     293596   -0.78
PanelKit/iphoneos                          :     291336     293596   -0.78
PromiseKit/appletvos                       :     263636     264628   -0.38
ReLax/appletvos                            :     156584     159652   -1.96
ReactiveCocoa/watchos                      :      91640      91960   -0.35
ReactiveSwift/watchos                      :     711774     719314   -1.06
Result/watchos                             :      49389      49945   -1.13
ReactiveSwift/watchos                      :     711662     719202   -1.06
Result/watchos                             :      49389      49945   -1.13
Realm/watchos                              :    3118605    3118605    0.00
ReSwift/watchos                            :      47853      48641   -1.65  
RxCocoa/iphoneos/arm64                     :     525336     529820   -0.85
RxCocoa/iphoneos/armv7                     :     484947     489203   -0.88
RxSwift/iphoneos/arm64                     :     900068     909924   -1.10
RxSwift/iphoneos/armv7                     :     850946     861450   -1.23
RxCocoa/iphoneos                           :    1010283    1019023   -0.87
RxSwift/iphoneos                           :    1751014    1771374   -1.16
RxSwift/appletvos                          :    1087784    1099264   -1.06
RxTest/appletvos                           :      78743      80039   -1.65
Siesta/macos                               :     603334     611178   -1.30
SiestaUI/macos                             :         48         48    0.00
Starscream/appletvos                       :     129709     131025   -1.01
SwiftDate/watchos                          :     318961     321833   -0.90
SwifterSwift/watchos                       :     414704     416216   -0.36
                                                                          
Total                                      :   40590274   40923954   -0.82

@aschwaighofer aschwaighofer merged commit 0b414e4 into swiftlang:master Oct 30, 2017
aschwaighofer added a commit to aschwaighofer/swift that referenced this pull request Oct 31, 2017
…payload_enum_witness"

This reverts commit 0b414e4, reversing
changes made to fb27e7d.

There are failures on the resilient bot and lldb test case fails.
eeckstein added a commit that referenced this pull request Oct 31, 2017
Revert "Merge pull request #12606 from aschwaighofer/single_payload_enum_witness"
aschwaighofer added a commit to aschwaighofer/swift that referenced this pull request Nov 1, 2017
Revert "Revert "Merge pull request swiftlang#12606 from aschwaighofer/single_payload_enum_witness""

This reverts commit c422f80.
rjmccall added a commit to rjmccall/swift that referenced this pull request Dec 12, 2018
This is essentially a long-belated follow-up to Arnold's swiftlang#12606.
The key observation here is that the enum-tag-single-payload witnesses
are strictly more powerful than the XI witnesses: you can simulate
the XI witnesses by using an extra case count that's <= the XI count.
Of course the result is less efficient than the XI witnesses, but
that's less important than overall code size, and we can work on
fast-paths for that.

The extra inhabitant count is stored in a 32-bit field (always present)
following the ValueWitnessFlags, which now occupy a fixed 32 bits.
This inflates non-XI VWTs on 32-bit targets by a word, but the net effect
on XI VWTs is to shrink them by two words, which is likely to be the
more important change.  Also, being able to access the XI count directly
should be a nice win.
rjmccall added a commit to rjmccall/swift that referenced this pull request Dec 12, 2018
This is essentially a long-belated follow-up to Arnold's swiftlang#12606.
The key observation here is that the enum-tag-single-payload witnesses
are strictly more powerful than the XI witnesses: you can simulate
the XI witnesses by using an extra case count that's <= the XI count.
Of course the result is less efficient than the XI witnesses, but
that's less important than overall code size, and we can work on
fast-paths for that.

The extra inhabitant count is stored in a 32-bit field (always present)
following the ValueWitnessFlags, which now occupy a fixed 32 bits.
This inflates non-XI VWTs on 32-bit targets by a word, but the net effect
on XI VWTs is to shrink them by two words, which is likely to be the
more important change.  Also, being able to access the XI count directly
should be a nice win.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants