Skip to content
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

[stdlib] Constrain BinaryInteger.Words to be a Collection #11178

Closed
wants to merge 5 commits into from

Conversation

lorentey
Copy link
Member

@lorentey lorentey commented Jul 25, 2017

BinaryInteger.Words could previously only be constrained to a Sequence of UInts; it is now possible to constrain it to Collection, so that we match the interface accepted in SE-104.

@moiseev
Copy link
Contributor

moiseev commented Jul 25, 2017

Can it be a stronger requirement, like a BidirectionalCollection for example?

@moiseev
Copy link
Contributor

moiseev commented Jul 25, 2017

@swift-ci Please smoke test

@lorentey
Copy link
Member Author

lorentey commented Jul 25, 2017

@moiseev Not yet (or at least not as easily): it leads to seemingly unrelated errors in BidirectionalCollection.swift and elsewhere, and then a compiler crash. I'll see if I can make sense of it.

It is also not yet possible to have Int.Words and UInt.Words conform to RandomAccessCollection -- so we can't replace their custom collections with CollectionOfOne yet.

@moiseev
Copy link
Contributor

moiseev commented Jul 25, 2017

@lorentey I don't understand your second point about inability to use CollectionOfOne. It is still a Collection so regardless of the constraints on Words it should be usable... What am I missing?

@lorentey
Copy link
Member Author

@moiseev Me neither! Something gets confused when [U]Int.Words is a random-access collection, but it's okay for Int8.Words and the rest of the integers. However, luckily we now get error messages rather than just a crash:

/Users/lorentey/Git/Swift/swift/stdlib/public/core/Indices.swift.gyb:127:17: error: 'Self.Indices.Indices.IndexDistance.Words.SubSequence.Element' cannot be equal to both 'Base.Element' and 'UInt'
  where Indices == DefaultBidirectionalIndices<Self>
                ^
/Users/lorentey/Git/Swift/swift/stdlib/public/core/Indices.swift.gyb:127:17: note: same-type constraint 'Self.Indices.Indices.IndexDistance.Words.Iterator.Element' == 'UInt' implied here
  where Indices == DefaultBidirectionalIndices<Self>
                ^
/Users/lorentey/Git/Swift/swift/stdlib/public/core/Indices.swift.gyb:127:17: error: 'Self.Indices.Indices.IndexDistance.Words.SubSequence.Element' cannot be equal to both 'Base.Element' and 'UInt'
  where Indices == DefaultBidirectionalIndices<Self>
                ^
/Users/lorentey/Git/Swift/swift/stdlib/public/core/Indices.swift.gyb:127:17: note: same-type constraint 'Self.Indices.Indices.IndexDistance.Words.Iterator.Element' == 'UInt' implied here
  where Indices == DefaultBidirectionalIndices<Self>
                ^
/Users/lorentey/Git/Swift/swift/stdlib/public/core/Indices.swift.gyb:127:17: error: 'Self.Indices.Indices.IndexDistance.Words.SubSequence.Iterator.Element' cannot be equal to both 'Elements.Element' and 'UInt'
  where Indices == DefaultBidirectionalIndices<Self>
                ^

(It goes on for a couple dozen more errors like this.) Does this ring a bell for you?

@moiseev
Copy link
Contributor

moiseev commented Jul 25, 2017

/Users/lorentey/Git/Swift/swift/stdlib/public/core/Indices.swift.gyb:127:17: error: 'Self.Indices.Indices.IndexDistance.Words.SubSequence.Element' cannot be equal to both 'Base.Element' and 'UInt'

This begs for a another equality constraint like SubSequence.Base.Element == UInt. But hard to tell... And no, I haven't seen anything like that before.

@moiseev
Copy link
Contributor

moiseev commented Jul 25, 2017

@swift-ci Please smoke benchmark

@moiseev
Copy link
Contributor

moiseev commented Jul 25, 2017

Since messing with constraints like this sometimes has an unwelcome changes in compilation time, I'd rather not merge this change without measuring the stdlib compile time with and without this patch applied.

@lorentey
Copy link
Member Author

Understood! 👍 Shall I time it on my end?

FWIW, my timings for incremental builds using ./swift/utils/build-script -R aren't great:

before: 264.68 real      1099.82 user        48.22 sys
after:  301.12 real      1223.43 user        53.47 sys

@moiseev
Copy link
Contributor

moiseev commented Jul 25, 2017

/cc @airspeedswift see above on the compilation time numbers.

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Improvement (2)
TEST OLD NEW DELTA SPEEDUP
ArrayInClass 69 61 -11.6% 1.13x (?)
ClassArrayGetter 14 13 -7.1% 1.08x
No Changes (325)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 2949 2949 +0.0% 1.00x
AnyHashableWithAClass 66717 66737 +0.0% 1.00x (?)
Array2D 2090 2042 -2.3% 1.02x (?)
ArrayAppend 769 768 -0.1% 1.00x (?)
ArrayAppendArrayOfInt 597 596 -0.2% 1.00x
ArrayAppendAscii 9911 9910 -0.0% 1.00x (?)
ArrayAppendFromGeneric 597 597 +0.0% 1.00x
ArrayAppendGenericStructs 1256 1235 -1.7% 1.02x (?)
ArrayAppendLatin1 30659 30961 +1.0% 0.99x (?)
ArrayAppendLazyMap 1016 1008 -0.8% 1.01x (?)
ArrayAppendOptionals 1242 1264 +1.8% 0.98x
ArrayAppendRepeatCol 838 838 +0.0% 1.00x
ArrayAppendReserved 533 534 +0.2% 1.00x (?)
ArrayAppendSequence 942 943 +0.1% 1.00x (?)
ArrayAppendStrings 13698 13735 +0.3% 1.00x
ArrayAppendToFromGeneric 597 597 +0.0% 1.00x
ArrayAppendToGeneric 597 597 +0.0% 1.00x
ArrayAppendUTF16 29184 29178 -0.0% 1.00x (?)
ArrayLiteral 1219 1217 -0.2% 1.00x (?)
ArrayOfGenericPOD 219 219 +0.0% 1.00x
ArrayOfGenericRef 4014 4007 -0.2% 1.00x (?)
ArrayOfPOD 166 166 +0.0% 1.00x
ArrayOfRef 3900 3907 +0.2% 1.00x (?)
ArrayPlusEqualArrayOfInt 597 597 +0.0% 1.00x
ArrayPlusEqualFiveElementCollection 4672 4707 +0.7% 0.99x (?)
ArrayPlusEqualSingleElementCollection 768 769 +0.1% 1.00x (?)
ArrayPlusEqualThreeElements 1596 1591 -0.3% 1.00x (?)
ArraySubscript 1453 1452 -0.1% 1.00x (?)
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 148 148 +0.0% 1.00x
ByteSwap 118 118 +0.0% 1.00x
CStringLongAscii 4479 4488 +0.2% 1.00x (?)
CStringLongNonAscii 2132 2131 -0.0% 1.00x (?)
CStringShortAscii 4746 4745 -0.0% 1.00x (?)
Calculator 31 31 +0.0% 1.00x
CaptureProp 4602 4602 +0.0% 1.00x
CharIndexing_ascii_unicodeScalars 14216 14221 +0.0% 1.00x (?)
CharIndexing_ascii_unicodeScalars_Backwards 11664 11663 -0.0% 1.00x (?)
CharIndexing_chinese_unicodeScalars 10773 10769 -0.0% 1.00x (?)
CharIndexing_chinese_unicodeScalars_Backwards 8847 8853 +0.1% 1.00x (?)
CharIndexing_japanese_unicodeScalars 17010 17011 +0.0% 1.00x (?)
CharIndexing_japanese_unicodeScalars_Backwards 13944 13946 +0.0% 1.00x (?)
CharIndexing_korean_unicodeScalars 13786 13786 +0.0% 1.00x
CharIndexing_korean_unicodeScalars_Backwards 11312 11318 +0.1% 1.00x (?)
CharIndexing_punctuatedJapanese_unicodeScalars 2592 2592 +0.0% 1.00x
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 2161 2160 -0.0% 1.00x (?)
CharIndexing_punctuated_unicodeScalars 3240 3239 -0.0% 1.00x (?)
CharIndexing_punctuated_unicodeScalars_Backwards 2687 2689 +0.1% 1.00x (?)
CharIndexing_russian_unicodeScalars 11846 11847 +0.0% 1.00x (?)
CharIndexing_russian_unicodeScalars_Backwards 9727 9728 +0.0% 1.00x (?)
CharIndexing_tweet_unicodeScalars 28037 28061 +0.1% 1.00x (?)
CharIndexing_tweet_unicodeScalars_Backwards 22958 22983 +0.1% 1.00x (?)
CharIndexing_utf16_unicodeScalars 78585 78624 +0.0% 1.00x (?)
CharIndexing_utf16_unicodeScalars_Backwards 78286 78271 -0.0% 1.00x (?)
CharIteration_ascii_unicodeScalars 16172 16168 -0.0% 1.00x (?)
CharIteration_ascii_unicodeScalars_Backwards 16769 16767 -0.0% 1.00x (?)
CharIteration_chinese_unicodeScalars 12287 12286 -0.0% 1.00x (?)
CharIteration_chinese_unicodeScalars_Backwards 12700 12698 -0.0% 1.00x (?)
CharIteration_japanese_unicodeScalars 19327 19322 -0.0% 1.00x (?)
CharIteration_japanese_unicodeScalars_Backwards 20078 20086 +0.0% 1.00x (?)
CharIteration_korean_unicodeScalars 15690 15685 -0.0% 1.00x (?)
CharIteration_korean_unicodeScalars_Backwards 16261 16259 -0.0% 1.00x (?)
CharIteration_punctuatedJapanese_unicodeScalars 2986 2985 -0.0% 1.00x (?)
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 3022 3020 -0.1% 1.00x (?)
CharIteration_punctuated_unicodeScalars 3708 3706 -0.1% 1.00x (?)
CharIteration_punctuated_unicodeScalars_Backwards 3783 3786 +0.1% 1.00x (?)
CharIteration_russian_unicodeScalars 13497 13496 -0.0% 1.00x (?)
CharIteration_russian_unicodeScalars_Backwards 13974 13975 +0.0% 1.00x (?)
CharIteration_tweet_unicodeScalars 31582 31582 +0.0% 1.00x
CharIteration_tweet_unicodeScalars_Backwards 33183 33161 -0.1% 1.00x (?)
CharIteration_utf16_unicodeScalars 92690 92719 +0.0% 1.00x (?)
CharIteration_utf16_unicodeScalars_Backwards 116650 116638 -0.0% 1.00x (?)
CharacterLiteralsLarge 6029 6027 -0.0% 1.00x (?)
CharacterLiteralsSmall 404 404 +0.0% 1.00x
Chars 419 419 +0.0% 1.00x
DeadArray 186 186 +0.0% 1.00x
Dictionary 557 556 -0.2% 1.00x (?)
Dictionary2 1827 1828 +0.1% 1.00x (?)
Dictionary2OfObjects 3313 3328 +0.5% 1.00x (?)
Dictionary3 445 444 -0.2% 1.00x
Dictionary3OfObjects 886 891 +0.6% 0.99x
DictionaryBridge 2547 2568 +0.8% 0.99x (?)
DictionaryGroup 274 274 +0.0% 1.00x
DictionaryGroupOfObjects 1789 1788 -0.1% 1.00x (?)
DictionaryLiteral 1479 1482 +0.2% 1.00x (?)
DictionaryOfObjects 2319 2322 +0.1% 1.00x (?)
DictionaryRemove 2580 2610 +1.2% 0.99x (?)
DictionaryRemoveOfObjects 23270 23259 -0.0% 1.00x (?)
DictionarySwap 466 465 -0.2% 1.00x
DictionarySwapOfObjects 6973 6924 -0.7% 1.01x (?)
DropFirstAnyCollection 56 56 +0.0% 1.00x
DropFirstAnyCollectionLazy 46499 46594 +0.2% 1.00x (?)
DropFirstAnySeqCRangeIter 29392 29401 +0.0% 1.00x (?)
DropFirstAnySeqCRangeIterLazy 29414 29399 -0.1% 1.00x
DropFirstAnySeqCntRange 50 50 +0.0% 1.00x
DropFirstAnySeqCntRangeLazy 50 50 +0.0% 1.00x
DropFirstAnySequence 10180 10209 +0.3% 1.00x (?)
DropFirstAnySequenceLazy 10219 10227 +0.1% 1.00x (?)
DropFirstArray 25 25 +0.0% 1.00x
DropFirstArrayLazy 24 24 +0.0% 1.00x
DropFirstCountableRange 32 32 +0.0% 1.00x
DropFirstCountableRangeLazy 32 32 +0.0% 1.00x
DropFirstSequence 2813 2813 +0.0% 1.00x
DropFirstSequenceLazy 2739 2740 +0.0% 1.00x
DropLastAnyCollection 22 22 +0.0% 1.00x
DropLastAnyCollectionLazy 15442 15436 -0.0% 1.00x (?)
DropLastAnySeqCRangeIter 5989 5989 +0.0% 1.00x
DropLastAnySeqCRangeIterLazy 5991 5986 -0.1% 1.00x (?)
DropLastAnySeqCntRange 16 16 +0.0% 1.00x
DropLastAnySeqCntRangeLazy 16 16 +0.0% 1.00x
DropLastAnySequence 8653 8655 +0.0% 1.00x (?)
DropLastAnySequenceLazy 8570 8569 -0.0% 1.00x (?)
DropLastArray 8 8 +0.0% 1.00x
DropLastArrayLazy 8 8 +0.0% 1.00x
DropLastCountableRange 10 10 +0.0% 1.00x
DropLastCountableRangeLazy 10 10 +0.0% 1.00x
DropLastSequence 590 592 +0.3% 1.00x
DropLastSequenceLazy 591 591 +0.0% 1.00x
DropWhileAnyCollection 70 70 +0.0% 1.00x
DropWhileAnyCollectionLazy 103 103 +0.0% 1.00x
DropWhileAnySeqCRangeIter 23356 23359 +0.0% 1.00x (?)
DropWhileAnySeqCRangeIterLazy 103 103 +0.0% 1.00x
DropWhileAnySeqCntRange 64 64 +0.0% 1.00x
DropWhileAnySeqCntRangeLazy 103 103 +0.0% 1.00x
DropWhileAnySequence 8477 8479 +0.0% 1.00x
DropWhileAnySequenceLazy 2734 2734 +0.0% 1.00x
DropWhileArray 37 37 +0.0% 1.00x
DropWhileArrayLazy 78 78 +0.0% 1.00x
DropWhileCountableRange 36 36 +0.0% 1.00x
DropWhileCountableRangeLazy 68 68 +0.0% 1.00x
DropWhileSequence 2108 2109 +0.0% 1.00x
DropWhileSequenceLazy 65 65 +0.0% 1.00x
EqualStringSubstring 387 387 +0.0% 1.00x
EqualSubstringString 387 387 +0.0% 1.00x
EqualSubstringSubstring 384 384 +0.0% 1.00x
EqualSubstringSubstringGenericEquatable 386 386 +0.0% 1.00x
ErrorHandling 2055 2067 +0.6% 0.99x (?)
FilterEvenUsingReduce 1296 1291 -0.4% 1.00x (?)
FilterEvenUsingReduceInto 145 145 +0.0% 1.00x
FrequenciesUsingReduce 7173 7160 -0.2% 1.00x (?)
FrequenciesUsingReduceInto 4256 4252 -0.1% 1.00x (?)
Hanoi 3315 3335 +0.6% 0.99x
HashTest 1689 1689 +0.0% 1.00x
Histogram 313 313 +0.0% 1.00x
Integrate 274 274 +0.0% 1.00x
IterateData 717 717 +0.0% 1.00x
Join 385 393 +2.1% 0.98x (?)
LazilyFilteredArrays 64854 64851 -0.0% 1.00x (?)
LazilyFilteredRange 3896 3898 +0.1% 1.00x (?)
LessSubstringSubstring 383 383 +0.0% 1.00x
LessSubstringSubstringGenericComparable 384 384 +0.0% 1.00x
LinkedList 7165 7165 +0.0% 1.00x
MapReduce 330 328 -0.6% 1.01x (?)
MapReduceAnyCollection 332 331 -0.3% 1.00x (?)
MapReduceAnyCollectionShort 2003 2003 +0.0% 1.00x
MapReduceClass 3074 3075 +0.0% 1.00x (?)
MapReduceClassShort 4529 4573 +1.0% 0.99x (?)
MapReduceLazyCollection 15 15 +0.0% 1.00x
MapReduceLazyCollectionShort 45 45 +0.0% 1.00x
MapReduceLazySequence 90 90 +0.0% 1.00x
MapReduceSequence 441 445 +0.9% 0.99x (?)
MapReduceShort 1926 1918 -0.4% 1.00x (?)
MapReduceShortString 21 22 +4.8% 0.95x
MapReduceString 106 106 +0.0% 1.00x
Memset 234 234 +0.0% 1.00x
MonteCarloE 10283 10285 +0.0% 1.00x (?)
MonteCarloPi 43909 43905 -0.0% 1.00x (?)
NSDictionaryCastToSwift 5508 5555 +0.9% 0.99x (?)
NSError 290 290 +0.0% 1.00x
NSStringConversion 361 361 +0.0% 1.00x
NopDeinit 22908 22908 +0.0% 1.00x
ObjectAllocation 180 179 -0.6% 1.01x (?)
ObjectiveCBridgeFromNSArrayAnyObject 22709 22351 -1.6% 1.02x (?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 3442 3459 +0.5% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 39258 39664 +1.0% 0.99x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 33640 33189 -1.3% 1.01x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 118598 119445 +0.7% 0.99x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 5335 5224 -2.1% 1.02x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 92073 95200 +3.4% 0.97x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 97660 100344 +2.7% 0.97x (?)
ObjectiveCBridgeFromNSSetAnyObject 65274 64622 -1.0% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 4177 4181 +0.1% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 67597 67410 -0.3% 1.00x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 68075 67512 -0.8% 1.01x (?)
ObjectiveCBridgeFromNSString 987 987 +0.0% 1.00x
ObjectiveCBridgeFromNSStringForced 1831 1830 -0.1% 1.00x (?)
ObjectiveCBridgeStubDataAppend 3700 3826 +3.4% 0.97x
ObjectiveCBridgeStubDateAccess 181 181 +0.0% 1.00x
ObjectiveCBridgeStubDateMutation 272 272 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 25344 25252 -0.4% 1.00x (?)
ObjectiveCBridgeStubFromNSDate 3705 3732 +0.7% 0.99x (?)
ObjectiveCBridgeStubFromNSDateRef 4005 4007 +0.0% 1.00x (?)
ObjectiveCBridgeStubFromNSString 533 533 +0.0% 1.00x
ObjectiveCBridgeStubFromNSStringRef 142 143 +0.7% 0.99x
ObjectiveCBridgeStubNSDataAppend 2310 2331 +0.9% 0.99x (?)
ObjectiveCBridgeStubNSDateMutationRef 13024 12467 -4.3% 1.04x (?)
ObjectiveCBridgeStubNSDateRefAccess 312 312 +0.0% 1.00x
ObjectiveCBridgeStubToArrayOfNSString 28991 29289 +1.0% 0.99x (?)
ObjectiveCBridgeStubToNSDate 15271 15214 -0.4% 1.00x (?)
ObjectiveCBridgeStubToNSDateRef 3170 3208 +1.2% 0.99x (?)
ObjectiveCBridgeStubToNSString 1516 1515 -0.1% 1.00x (?)
ObjectiveCBridgeStubToNSStringRef 110 109 -0.9% 1.01x (?)
ObjectiveCBridgeStubURLAppendPath 225023 226146 +0.5% 1.00x (?)
ObjectiveCBridgeStubURLAppendPathRef 225513 225582 +0.0% 1.00x (?)
ObjectiveCBridgeToNSArray 28419 28719 +1.1% 0.99x (?)
ObjectiveCBridgeToNSDictionary 44896 45042 +0.3% 1.00x (?)
ObjectiveCBridgeToNSSet 38443 38508 +0.2% 1.00x (?)
ObjectiveCBridgeToNSString 1277 1276 -0.1% 1.00x (?)
ObserverClosure 2286 2280 -0.3% 1.00x (?)
ObserverForwarderStruct 1133 1126 -0.6% 1.01x (?)
ObserverPartiallyAppliedMethod 3806 3801 -0.1% 1.00x (?)
ObserverUnappliedMethod 2641 2652 +0.4% 1.00x (?)
OpenClose 51 51 +0.0% 1.00x
Phonebook 5946 5947 +0.0% 1.00x (?)
PolymorphicCalls 22 22 +0.0% 1.00x
PopFrontArray 1213 1212 -0.1% 1.00x (?)
PopFrontArrayGeneric 1212 1213 +0.1% 1.00x (?)
PopFrontUnsafePointer 9513 9522 +0.1% 1.00x (?)
PrefixAnyCollection 56 56 +0.0% 1.00x
PrefixAnyCollectionLazy 46206 46268 +0.1% 1.00x (?)
PrefixAnySeqCRangeIter 22852 22855 +0.0% 1.00x (?)
PrefixAnySeqCRangeIterLazy 22845 22852 +0.0% 1.00x (?)
PrefixAnySeqCntRange 50 50 +0.0% 1.00x
PrefixAnySeqCntRangeLazy 50 50 +0.0% 1.00x
PrefixAnySequence 8429 8437 +0.1% 1.00x
PrefixAnySequenceLazy 8428 8424 -0.0% 1.00x
PrefixArray 25 25 +0.0% 1.00x
PrefixArrayLazy 25 25 +0.0% 1.00x
PrefixCountableRange 32 32 +0.0% 1.00x
PrefixCountableRangeLazy 32 32 +0.0% 1.00x
PrefixSequence 2092 2092 +0.0% 1.00x
PrefixSequenceLazy 2055 2054 -0.0% 1.00x (?)
PrefixWhileAnyCollection 96 96 +0.0% 1.00x
PrefixWhileAnyCollectionLazy 75 75 +0.0% 1.00x
PrefixWhileAnySeqCRangeIter 16680 16678 -0.0% 1.00x (?)
PrefixWhileAnySeqCRangeIterLazy 75 75 +0.0% 1.00x
PrefixWhileAnySeqCntRange 90 90 +0.0% 1.00x
PrefixWhileAnySeqCntRangeLazy 75 75 +0.0% 1.00x
PrefixWhileAnySequence 18687 18681 -0.0% 1.00x (?)
PrefixWhileAnySequenceLazy 2181 2181 +0.0% 1.00x
PrefixWhileArray 62 62 +0.0% 1.00x
PrefixWhileArrayLazy 49 49 +0.0% 1.00x
PrefixWhileCountableRange 36 36 +0.0% 1.00x
PrefixWhileCountableRangeLazy 32 32 +0.0% 1.00x
PrefixWhileSequence 286 286 +0.0% 1.00x
PrefixWhileSequenceLazy 28 28 +0.0% 1.00x
Prims 749 750 +0.1% 1.00x (?)
ProtocolDispatch 2728 2727 -0.0% 1.00x
ProtocolDispatch2 164 164 +0.0% 1.00x
RC4 159 159 +0.0% 1.00x
RGBHistogram 2390 2398 +0.3% 1.00x (?)
RGBHistogramOfObjects 23466 23436 -0.1% 1.00x (?)
RangeAssignment 314 313 -0.3% 1.00x (?)
RecursiveOwnedParameter 2330 2329 -0.0% 1.00x (?)
ReversedArray 49 51 +4.1% 0.96x (?)
ReversedBidirectional 30304 30303 -0.0% 1.00x (?)
ReversedDictionary 116 117 +0.9% 0.99x (?)
SetExclusiveOr 3129 3110 -0.6% 1.01x (?)
SetExclusiveOr_OfObjects 8154 8149 -0.1% 1.00x (?)
SetIntersect 294 294 +0.0% 1.00x
SetIntersect_OfObjects 1747 1734 -0.7% 1.01x
SetIsSubsetOf 292 292 +0.0% 1.00x
SetIsSubsetOf_OfObjects 359 359 +0.0% 1.00x
SetUnion 2876 2872 -0.1% 1.00x (?)
SetUnion_OfObjects 6665 6683 +0.3% 1.00x (?)
SevenBoom 1470 1472 +0.1% 1.00x (?)
Sim2DArray 276 276 +0.0% 1.00x
SortLargeExistentials 7805 7804 -0.0% 1.00x (?)
SortLettersInPlace 1146 1146 +0.0% 1.00x
SortSortedStrings 874 873 -0.1% 1.00x (?)
SortStrings 1651 1651 +0.0% 1.00x
SortStringsUnicode 7591 7606 +0.2% 1.00x
StackPromo 22256 22254 -0.0% 1.00x (?)
StaticArray 18 18 +0.0% 1.00x
StrComplexWalk 720 720 +0.0% 1.00x
StrToInt 1961 1961 +0.0% 1.00x
StringAdder 3533 3510 -0.7% 1.01x
StringBuilder 1029 1026 -0.3% 1.00x (?)
StringBuilderLong 944 952 +0.8% 0.99x (?)
StringEdits 117511 117465 -0.0% 1.00x (?)
StringEqualPointerComparison 333 333 +0.0% 1.00x
StringFromLongWholeSubstring 14179 14144 -0.2% 1.00x (?)
StringFromLongWholeSubstringGeneric 22 22 +0.0% 1.00x
StringHasPrefix 16 16 +0.0% 1.00x
StringHasPrefixUnicode 13955 13995 +0.3% 1.00x (?)
StringHasSuffix 16 16 +0.0% 1.00x
StringHasSuffixUnicode 61845 61778 -0.1% 1.00x (?)
StringInterpolation 10912 10973 +0.6% 0.99x (?)
StringMatch 7667 7670 +0.0% 1.00x (?)
StringUTF16Builder 1907 1896 -0.6% 1.01x (?)
StringWalk 1295 1295 +0.0% 1.00x
StringWithCString 56332 56339 +0.0% 1.00x (?)
SubstringComparable 1541 1539 -0.1% 1.00x
SubstringEqualString 1444 1445 +0.1% 1.00x
SubstringEquatable 3439 3442 +0.1% 1.00x (?)
SubstringFromLongString 10 10 +0.0% 1.00x
SubstringFromLongStringGeneric 64 64 +0.0% 1.00x
SuffixAnyCollection 22 22 +0.0% 1.00x
SuffixAnyCollectionLazy 15478 15497 +0.1% 1.00x (?)
SuffixAnySeqCRangeIter 6333 6339 +0.1% 1.00x (?)
SuffixAnySeqCRangeIterLazy 6354 6339 -0.2% 1.00x (?)
SuffixAnySeqCntRange 16 16 +0.0% 1.00x
SuffixAnySeqCntRangeLazy 16 16 +0.0% 1.00x
SuffixAnySequence 8886 8927 +0.5% 1.00x (?)
SuffixAnySequenceLazy 8683 8719 +0.4% 1.00x (?)
SuffixArray 8 8 +0.0% 1.00x
SuffixArrayLazy 11 11 +0.0% 1.00x
SuffixCountableRange 10 10 +0.0% 1.00x
SuffixCountableRangeLazy 11 11 +0.0% 1.00x
SuffixSequence 5900 5877 -0.4% 1.00x
SuffixSequenceLazy 5901 5870 -0.5% 1.01x (?)
SumUsingReduce 97 97 +0.0% 1.00x
SumUsingReduceInto 97 97 +0.0% 1.00x
SuperChars 81075 80870 -0.3% 1.00x (?)
TwoSum 976 977 +0.1% 1.00x (?)
TypeFlood 0 0 +0.0% 1.00x
UTF8Decode 260 260 +0.0% 1.00x
Walsh 353 353 +0.0% 1.00x
XorLoop 347 347 +0.0% 1.00x
accessGlobal 3 3 +0.0% 1.00x
accessInMatSet 18 18 +0.0% 1.00x
accessIndependent 2 2 +0.0% 1.00x

Unoptimized (Onone)

Improvement (1)
TEST OLD NEW DELTA SPEEDUP
PrefixWhileArrayLazy 24905 22145 -11.1% 1.12x (?)
No Changes (326)
TEST OLD NEW DELTA SPEEDUP
AngryPhonebook 5645 5633 -0.2% 1.00x (?)
AnyHashableWithAClass 84200 84401 +0.2% 1.00x (?)
Array2D 603816 604355 +0.1% 1.00x (?)
ArrayAppend 3905 3904 -0.0% 1.00x (?)
ArrayAppendArrayOfInt 652 652 +0.0% 1.00x
ArrayAppendAscii 51788 51761 -0.1% 1.00x (?)
ArrayAppendFromGeneric 656 656 +0.0% 1.00x
ArrayAppendGenericStructs 1378 1373 -0.4% 1.00x (?)
ArrayAppendLatin1 73742 73923 +0.2% 1.00x
ArrayAppendLazyMap 304188 300204 -1.3% 1.01x (?)
ArrayAppendOptionals 1300 1318 +1.4% 0.99x (?)
ArrayAppendRepeatCol 232053 232086 +0.0% 1.00x (?)
ArrayAppendReserved 3931 3939 +0.2% 1.00x (?)
ArrayAppendSequence 114474 114378 -0.1% 1.00x
ArrayAppendStrings 13813 13745 -0.5% 1.00x (?)
ArrayAppendToFromGeneric 655 655 +0.0% 1.00x
ArrayAppendToGeneric 656 656 +0.0% 1.00x
ArrayAppendUTF16 74999 75052 +0.1% 1.00x (?)
ArrayInClass 6438 6422 -0.2% 1.00x (?)
ArrayLiteral 1769 1748 -1.2% 1.01x (?)
ArrayOfGenericPOD 2981 2980 -0.0% 1.00x
ArrayOfGenericRef 10049 10043 -0.1% 1.00x (?)
ArrayOfPOD 1832 1832 +0.0% 1.00x
ArrayOfRef 9047 9053 +0.1% 1.00x
ArrayPlusEqualArrayOfInt 654 654 +0.0% 1.00x
ArrayPlusEqualFiveElementCollection 298710 298654 -0.0% 1.00x (?)
ArrayPlusEqualSingleElementCollection 299212 297239 -0.7% 1.01x (?)
ArrayPlusEqualThreeElements 10867 10989 +1.1% 0.99x
ArraySubscript 4168 4172 +0.1% 1.00x (?)
ArrayValueProp 3526 3512 -0.4% 1.00x (?)
ArrayValueProp2 22695 22651 -0.2% 1.00x (?)
ArrayValueProp3 3906 3899 -0.2% 1.00x
ArrayValueProp4 3823 3824 +0.0% 1.00x (?)
BitCount 1744 1744 +0.0% 1.00x
ByteSwap 4277 4292 +0.4% 1.00x (?)
CStringLongAscii 4468 4504 +0.8% 0.99x (?)
CStringLongNonAscii 2304 2307 +0.1% 1.00x (?)
CStringShortAscii 9082 9076 -0.1% 1.00x (?)
Calculator 1169 1163 -0.5% 1.01x
CaptureProp 130964 130464 -0.4% 1.00x (?)
CharIndexing_ascii_unicodeScalars 584657 586117 +0.2% 1.00x (?)
CharIndexing_ascii_unicodeScalars_Backwards 625770 647739 +3.5% 0.97x (?)
CharIndexing_chinese_unicodeScalars 440433 441612 +0.3% 1.00x (?)
CharIndexing_chinese_unicodeScalars_Backwards 485837 491854 +1.2% 0.99x
CharIndexing_japanese_unicodeScalars 713652 714565 +0.1% 1.00x (?)
CharIndexing_japanese_unicodeScalars_Backwards 755651 761629 +0.8% 0.99x (?)
CharIndexing_korean_unicodeScalars 565676 575150 +1.7% 0.98x (?)
CharIndexing_korean_unicodeScalars_Backwards 614763 620207 +0.9% 0.99x (?)
CharIndexing_punctuatedJapanese_unicodeScalars 101109 100801 -0.3% 1.00x (?)
CharIndexing_punctuatedJapanese_unicodeScalars_Backwards 110229 111157 +0.8% 0.99x (?)
CharIndexing_punctuated_unicodeScalars 127624 127832 +0.2% 1.00x (?)
CharIndexing_punctuated_unicodeScalars_Backwards 137870 136440 -1.0% 1.01x (?)
CharIndexing_russian_unicodeScalars 485133 490686 +1.1% 0.99x
CharIndexing_russian_unicodeScalars_Backwards 536022 534595 -0.3% 1.00x (?)
CharIndexing_tweet_unicodeScalars 1157747 1157427 -0.0% 1.00x (?)
CharIndexing_tweet_unicodeScalars_Backwards 1275602 1311261 +2.8% 0.97x (?)
CharIndexing_utf16_unicodeScalars 647936 644199 -0.6% 1.01x (?)
CharIndexing_utf16_unicodeScalars_Backwards 687576 685931 -0.2% 1.00x (?)
CharIteration_ascii_unicodeScalars 224607 224596 -0.0% 1.00x (?)
CharIteration_ascii_unicodeScalars_Backwards 393116 392699 -0.1% 1.00x (?)
CharIteration_chinese_unicodeScalars 169864 169821 -0.0% 1.00x (?)
CharIteration_chinese_unicodeScalars_Backwards 301069 296458 -1.5% 1.02x (?)
CharIteration_japanese_unicodeScalars 268759 268656 -0.0% 1.00x (?)
CharIteration_japanese_unicodeScalars_Backwards 470955 470873 -0.0% 1.00x (?)
CharIteration_korean_unicodeScalars 217916 217934 +0.0% 1.00x (?)
CharIteration_korean_unicodeScalars_Backwards 382418 382235 -0.0% 1.00x (?)
CharIteration_punctuatedJapanese_unicodeScalars 39687 39703 +0.0% 1.00x (?)
CharIteration_punctuatedJapanese_unicodeScalars_Backwards 68487 68087 -0.6% 1.01x (?)
CharIteration_punctuated_unicodeScalars 49867 49873 +0.0% 1.00x (?)
CharIteration_punctuated_unicodeScalars_Backwards 86887 86259 -0.7% 1.01x (?)
CharIteration_russian_unicodeScalars 186705 186755 +0.0% 1.00x (?)
CharIteration_russian_unicodeScalars_Backwards 326383 326349 -0.0% 1.00x (?)
CharIteration_tweet_unicodeScalars 444553 444436 -0.0% 1.00x (?)
CharIteration_tweet_unicodeScalars_Backwards 784166 789761 +0.7% 0.99x (?)
CharIteration_utf16_unicodeScalars 245561 245545 -0.0% 1.00x (?)
CharIteration_utf16_unicodeScalars_Backwards 478956 478872 -0.0% 1.00x (?)
CharacterLiteralsLarge 6189 6205 +0.3% 1.00x (?)
CharacterLiteralsSmall 676 676 +0.0% 1.00x
Chars 66630 66666 +0.1% 1.00x (?)
ClassArrayGetter 986 986 +0.0% 1.00x
DeadArray 114349 115220 +0.8% 0.99x (?)
Dictionary 3512 3513 +0.0% 1.00x (?)
Dictionary2 3473 3483 +0.3% 1.00x (?)
Dictionary2OfObjects 6164 6155 -0.1% 1.00x (?)
Dictionary3 1308 1297 -0.8% 1.01x (?)
Dictionary3OfObjects 2378 2366 -0.5% 1.01x
DictionaryBridge 2618 2655 +1.4% 0.99x (?)
DictionaryGroup 5277 5278 +0.0% 1.00x (?)
DictionaryGroupOfObjects 8832 8825 -0.1% 1.00x (?)
DictionaryLiteral 8251 8277 +0.3% 1.00x (?)
DictionaryOfObjects 7035 7016 -0.3% 1.00x (?)
DictionaryRemove 21583 21558 -0.1% 1.00x (?)
DictionaryRemoveOfObjects 59466 59888 +0.7% 0.99x (?)
DictionarySwap 5370 5480 +2.0% 0.98x (?)
DictionarySwapOfObjects 22893 23082 +0.8% 0.99x
DropFirstAnyCollection 20394 20388 -0.0% 1.00x (?)
DropFirstAnyCollectionLazy 152365 151739 -0.4% 1.00x (?)
DropFirstAnySeqCRangeIter 31171 31169 -0.0% 1.00x (?)
DropFirstAnySeqCRangeIterLazy 31191 31185 -0.0% 1.00x (?)
DropFirstAnySeqCntRange 20379 20387 +0.0% 1.00x (?)
DropFirstAnySeqCntRangeLazy 20514 20511 -0.0% 1.00x (?)
DropFirstAnySequence 16779 16781 +0.0% 1.00x (?)
DropFirstAnySequenceLazy 16792 16793 +0.0% 1.00x (?)
DropFirstArray 10293 10294 +0.0% 1.00x (?)
DropFirstArrayLazy 52742 53646 +1.7% 0.98x (?)
DropFirstCountableRange 339 339 +0.0% 1.00x
DropFirstCountableRangeLazy 38759 38971 +0.5% 0.99x
DropFirstSequence 15587 15591 +0.0% 1.00x (?)
DropFirstSequenceLazy 15521 15527 +0.0% 1.00x (?)
DropLastAnyCollection 6819 6818 -0.0% 1.00x (?)
DropLastAnyCollectionLazy 51392 51493 +0.2% 1.00x (?)
DropLastAnySeqCRangeIter 47005 47052 +0.1% 1.00x (?)
DropLastAnySeqCRangeIterLazy 47254 47264 +0.0% 1.00x (?)
DropLastAnySeqCntRange 6806 6806 +0.0% 1.00x
DropLastAnySeqCntRangeLazy 6824 6823 -0.0% 1.00x (?)
DropLastAnySequence 32232 32208 -0.1% 1.00x
DropLastAnySequenceLazy 32214 32324 +0.3% 1.00x (?)
DropLastArray 3439 3439 +0.0% 1.00x
DropLastArrayLazy 17941 17652 -1.6% 1.02x (?)
DropLastCountableRange 118 118 +0.0% 1.00x
DropLastCountableRangeLazy 12970 12964 -0.0% 1.00x (?)
DropLastSequence 31912 31905 -0.0% 1.00x (?)
DropLastSequenceLazy 31763 31759 -0.0% 1.00x (?)
DropWhileAnyCollection 26090 26103 +0.0% 1.00x (?)
DropWhileAnyCollectionLazy 30000 30010 +0.0% 1.00x (?)
DropWhileAnySeqCRangeIter 33059 33061 +0.0% 1.00x (?)
DropWhileAnySeqCRangeIterLazy 30028 30413 +1.3% 0.99x (?)
DropWhileAnySeqCntRange 26114 26116 +0.0% 1.00x (?)
DropWhileAnySeqCntRangeLazy 30004 30250 +0.8% 0.99x
DropWhileAnySequence 17100 17091 -0.1% 1.00x
DropWhileAnySequenceLazy 15253 15255 +0.0% 1.00x (?)
DropWhileArray 13841 13842 +0.0% 1.00x (?)
DropWhileArrayLazy 26107 26134 +0.1% 1.00x (?)
DropWhileCountableRange 6053 6049 -0.1% 1.00x (?)
DropWhileCountableRangeLazy 28971 28977 +0.0% 1.00x (?)
DropWhileSequence 15978 15977 -0.0% 1.00x (?)
DropWhileSequenceLazy 14195 14185 -0.1% 1.00x (?)
EqualStringSubstring 666 666 +0.0% 1.00x
EqualSubstringString 662 662 +0.0% 1.00x
EqualSubstringSubstring 774 774 +0.0% 1.00x
EqualSubstringSubstringGenericEquatable 416 416 +0.0% 1.00x
ErrorHandling 7699 7802 +1.3% 0.99x
FilterEvenUsingReduce 4864 4868 +0.1% 1.00x (?)
FilterEvenUsingReduceInto 3115 3107 -0.3% 1.00x (?)
FrequenciesUsingReduce 16607 16494 -0.7% 1.01x (?)
FrequenciesUsingReduceInto 9525 9419 -1.1% 1.01x (?)
Hanoi 18410 18393 -0.1% 1.00x (?)
HashTest 18409 18420 +0.1% 1.00x (?)
Histogram 9945 9973 +0.3% 1.00x (?)
Integrate 688 688 +0.0% 1.00x
IterateData 12749 12750 +0.0% 1.00x (?)
Join 1459 1454 -0.3% 1.00x (?)
LazilyFilteredArrays 2035765 2040069 +0.2% 1.00x (?)
LazilyFilteredRange 758679 758528 -0.0% 1.00x (?)
LessSubstringSubstring 778 775 -0.4% 1.00x (?)
LessSubstringSubstringGenericComparable 439 439 +0.0% 1.00x
LinkedList 40049 40044 -0.0% 1.00x (?)
MapReduce 44484 44496 +0.0% 1.00x (?)
MapReduceAnyCollection 44331 44390 +0.1% 1.00x (?)
MapReduceAnyCollectionShort 57169 56976 -0.3% 1.00x (?)
MapReduceClass 49879 49807 -0.1% 1.00x (?)
MapReduceClassShort 61223 61113 -0.2% 1.00x (?)
MapReduceLazyCollection 43294 43278 -0.0% 1.00x (?)
MapReduceLazyCollectionShort 55316 55163 -0.3% 1.00x
MapReduceLazySequence 31918 31932 +0.0% 1.00x (?)
MapReduceSequence 50223 50094 -0.3% 1.00x (?)
MapReduceShort 57049 57568 +0.9% 0.99x (?)
MapReduceShortString 320 316 -1.2% 1.01x (?)
MapReduceString 3155 3155 +0.0% 1.00x
Memset 43952 43953 +0.0% 1.00x (?)
MonteCarloE 147243 147258 +0.0% 1.00x (?)
MonteCarloPi 52509 52503 -0.0% 1.00x (?)
NSDictionaryCastToSwift 6589 6670 +1.2% 0.99x (?)
NSError 712 711 -0.1% 1.00x (?)
NSStringConversion 403 403 +0.0% 1.00x
NopDeinit 171829 171692 -0.1% 1.00x (?)
ObjectAllocation 1654 1651 -0.2% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObject 24608 24732 +0.5% 0.99x (?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 6730 6719 -0.2% 1.00x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 40513 40308 -0.5% 1.01x (?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 34157 34155 -0.0% 1.00x (?)
ObjectiveCBridgeFromNSDictionaryAnyObject 122459 122224 -0.2% 1.00x (?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7621 7986 +4.8% 0.95x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 99498 98199 -1.3% 1.01x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 104227 99975 -4.1% 1.04x (?)
ObjectiveCBridgeFromNSSetAnyObject 69790 69212 -0.8% 1.01x (?)
ObjectiveCBridgeFromNSSetAnyObjectForced 7620 7669 +0.6% 0.99x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 72616 72999 +0.5% 0.99x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 71545 73680 +3.0% 0.97x (?)
ObjectiveCBridgeFromNSString 3833 3839 +0.2% 1.00x (?)
ObjectiveCBridgeFromNSStringForced 2225 2225 +0.0% 1.00x
ObjectiveCBridgeStubDataAppend 3978 3983 +0.1% 1.00x (?)
ObjectiveCBridgeStubDateAccess 1003 1003 +0.0% 1.00x
ObjectiveCBridgeStubDateMutation 515 517 +0.4% 1.00x (?)
ObjectiveCBridgeStubFromArrayOfNSString 24772 25391 +2.5% 0.98x (?)
ObjectiveCBridgeStubFromNSDate 4182 4157 -0.6% 1.01x (?)
ObjectiveCBridgeStubFromNSDateRef 4401 4399 -0.0% 1.00x (?)
ObjectiveCBridgeStubFromNSString 569 570 +0.2% 1.00x (?)
ObjectiveCBridgeStubFromNSStringRef 181 182 +0.6% 0.99x
ObjectiveCBridgeStubNSDataAppend 2727 2821 +3.4% 0.97x (?)
ObjectiveCBridgeStubNSDateMutationRef 15566 15640 +0.5% 1.00x (?)
ObjectiveCBridgeStubNSDateRefAccess 1209 1209 +0.0% 1.00x
ObjectiveCBridgeStubToArrayOfNSString 28924 28758 -0.6% 1.01x (?)
ObjectiveCBridgeStubToNSDate 15496 14813 -4.4% 1.05x (?)
ObjectiveCBridgeStubToNSDateRef 3333 3324 -0.3% 1.00x (?)
ObjectiveCBridgeStubToNSString 1565 1559 -0.4% 1.00x (?)
ObjectiveCBridgeStubToNSStringRef 155 155 +0.0% 1.00x
ObjectiveCBridgeStubURLAppendPath 232800 225567 -3.1% 1.03x (?)
ObjectiveCBridgeStubURLAppendPathRef 225847 226379 +0.2% 1.00x (?)
ObjectiveCBridgeToNSArray 29301 28687 -2.1% 1.02x (?)
ObjectiveCBridgeToNSDictionary 44637 44959 +0.7% 0.99x (?)
ObjectiveCBridgeToNSSet 38801 40007 +3.1% 0.97x
ObjectiveCBridgeToNSString 1305 1308 +0.2% 1.00x (?)
ObserverClosure 7468 7466 -0.0% 1.00x (?)
ObserverForwarderStruct 5518 5519 +0.0% 1.00x (?)
ObserverPartiallyAppliedMethod 8903 8903 +0.0% 1.00x
ObserverUnappliedMethod 9388 9361 -0.3% 1.00x (?)
OpenClose 392 392 +0.0% 1.00x
Phonebook 21916 21927 +0.1% 1.00x (?)
PolymorphicCalls 5251 5245 -0.1% 1.00x
PopFrontArray 9872 9873 +0.0% 1.00x (?)
PopFrontArrayGeneric 8850 8851 +0.0% 1.00x (?)
PopFrontUnsafePointer 98517 98417 -0.1% 1.00x (?)
PrefixAnyCollection 20378 20379 +0.0% 1.00x (?)
PrefixAnyCollectionLazy 153027 153223 +0.1% 1.00x (?)
PrefixAnySeqCRangeIter 24666 24680 +0.1% 1.00x (?)
PrefixAnySeqCRangeIterLazy 24938 24932 -0.0% 1.00x (?)
PrefixAnySeqCntRange 20360 20365 +0.0% 1.00x (?)
PrefixAnySeqCntRangeLazy 21499 21197 -1.4% 1.01x (?)
PrefixAnySequence 13618 13621 +0.0% 1.00x (?)
PrefixAnySequenceLazy 13655 13652 -0.0% 1.00x (?)
PrefixArray 10292 10292 +0.0% 1.00x
PrefixArrayLazy 52226 52755 +1.0% 0.99x (?)
PrefixCountableRange 339 339 +0.0% 1.00x
PrefixCountableRangeLazy 39092 38773 -0.8% 1.01x (?)
PrefixSequence 12900 12871 -0.2% 1.00x (?)
PrefixSequenceLazy 12551 12542 -0.1% 1.00x (?)
PrefixWhileAnyCollection 37361 37356 -0.0% 1.00x (?)
PrefixWhileAnyCollectionLazy 26521 26477 -0.2% 1.00x (?)
PrefixWhileAnySeqCRangeIter 46014 46426 +0.9% 0.99x
PrefixWhileAnySeqCRangeIterLazy 25879 25862 -0.1% 1.00x (?)
PrefixWhileAnySeqCntRange 37402 37379 -0.1% 1.00x (?)
PrefixWhileAnySeqCntRangeLazy 26626 26618 -0.0% 1.00x (?)
PrefixWhileAnySequence 36046 35376 -1.9% 1.02x (?)
PrefixWhileAnySequenceLazy 14866 14875 +0.1% 1.00x
PrefixWhileArray 20835 20838 +0.0% 1.00x (?)
PrefixWhileCountableRange 17208 17208 +0.0% 1.00x
PrefixWhileCountableRangeLazy 24779 24759 -0.1% 1.00x (?)
PrefixWhileSequence 34067 34336 +0.8% 0.99x
PrefixWhileSequenceLazy 14368 14368 +0.0% 1.00x
Prims 10487 10487 +0.0% 1.00x
ProtocolDispatch 7264 7274 +0.1% 1.00x (?)
ProtocolDispatch2 489 489 +0.0% 1.00x
RC4 19759 19763 +0.0% 1.00x (?)
RGBHistogram 36016 35983 -0.1% 1.00x (?)
RGBHistogramOfObjects 110245 109946 -0.3% 1.00x (?)
RangeAssignment 5737 5752 +0.3% 1.00x (?)
RecursiveOwnedParameter 11288 11288 +0.0% 1.00x
ReversedArray 52977 52977 +0.0% 1.00x
ReversedBidirectional 86806 87595 +0.9% 0.99x (?)
ReversedDictionary 36080 36058 -0.1% 1.00x (?)
SetExclusiveOr 21491 21477 -0.1% 1.00x (?)
SetExclusiveOr_OfObjects 48230 48180 -0.1% 1.00x (?)
SetIntersect 10990 10990 +0.0% 1.00x
SetIntersect_OfObjects 12636 12647 +0.1% 1.00x (?)
SetIsSubsetOf 1681 1682 +0.1% 1.00x (?)
SetIsSubsetOf_OfObjects 1593 1592 -0.1% 1.00x (?)
SetUnion 11860 11934 +0.6% 0.99x (?)
SetUnion_OfObjects 33644 33628 -0.0% 1.00x (?)
SevenBoom 1602 1607 +0.3% 1.00x (?)
Sim2DArray 44756 44749 -0.0% 1.00x (?)
SortLargeExistentials 17858 17861 +0.0% 1.00x (?)
SortLettersInPlace 3151 3144 -0.2% 1.00x (?)
SortSortedStrings 1416 1416 +0.0% 1.00x
SortStrings 2456 2455 -0.0% 1.00x (?)
SortStringsUnicode 8922 8927 +0.1% 1.00x (?)
StackPromo 102945 103433 +0.5% 1.00x (?)
StaticArray 4705 4692 -0.3% 1.00x
StrComplexWalk 6777 6776 -0.0% 1.00x (?)
StrToInt 107160 106868 -0.3% 1.00x (?)
StringAdder 3771 3780 +0.2% 1.00x (?)
StringBuilder 8390 8409 +0.2% 1.00x (?)
StringBuilderLong 1132 1133 +0.1% 1.00x
StringEdits 418743 413912 -1.2% 1.01x (?)
StringEqualPointerComparison 2593 2595 +0.1% 1.00x
StringFromLongWholeSubstring 13222 13226 +0.0% 1.00x (?)
StringFromLongWholeSubstringGeneric 205 206 +0.5% 1.00x (?)
StringHasPrefix 1668 1671 +0.2% 1.00x (?)
StringHasPrefixUnicode 16090 16066 -0.1% 1.00x (?)
StringHasSuffix 1832 1827 -0.3% 1.00x (?)
StringHasSuffixUnicode 63664 63766 +0.2% 1.00x (?)
StringInterpolation 13943 14066 +0.9% 0.99x
StringMatch 35372 35448 +0.2% 1.00x (?)
StringUTF16Builder 9246 9234 -0.1% 1.00x (?)
StringWalk 12442 12435 -0.1% 1.00x (?)
StringWithCString 54582 54588 +0.0% 1.00x (?)
SubstringComparable 4722 4723 +0.0% 1.00x (?)
SubstringEqualString 6647 6609 -0.6% 1.01x (?)
SubstringEquatable 9409 9421 +0.1% 1.00x (?)
SubstringFromLongString 13 13 +0.0% 1.00x
SubstringFromLongStringGeneric 108 108 +0.0% 1.00x
SuffixAnyCollection 6822 6824 +0.0% 1.00x (?)
SuffixAnyCollectionLazy 51472 51476 +0.0% 1.00x (?)
SuffixAnySeqCRangeIter 45360 45180 -0.4% 1.00x (?)
SuffixAnySeqCRangeIterLazy 45046 45081 +0.1% 1.00x
SuffixAnySeqCntRange 6857 6858 +0.0% 1.00x
SuffixAnySeqCntRangeLazy 6940 6957 +0.2% 1.00x (?)
SuffixAnySequence 30170 30165 -0.0% 1.00x (?)
SuffixAnySequenceLazy 30208 30090 -0.4% 1.00x (?)
SuffixArray 3445 3447 +0.1% 1.00x (?)
SuffixArrayLazy 18105 17819 -1.6% 1.02x (?)
SuffixCountableRange 117 117 +0.0% 1.00x
SuffixCountableRangeLazy 13096 13005 -0.7% 1.01x (?)
SuffixSequence 30027 30082 +0.2% 1.00x
SuffixSequenceLazy 29740 29745 +0.0% 1.00x (?)
SumUsingReduce 288344 288361 +0.0% 1.00x (?)
SumUsingReduceInto 286133 286215 +0.0% 1.00x (?)
SuperChars 220155 220539 +0.2% 1.00x (?)
TwoSum 4262 4247 -0.4% 1.00x (?)
TypeFlood 163 161 -1.2% 1.01x (?)
UTF8Decode 49253 49247 -0.0% 1.00x (?)
Walsh 11885 11861 -0.2% 1.00x (?)
XorLoop 23712 23712 +0.0% 1.00x
accessGlobal 175 175 +0.0% 1.00x
accessInMatSet 325 327 +0.6% 0.99x
accessIndependent 124 124 +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

This resolves a build time performance regression introduced in
the previous commit.
This allows the use of these properties on BinaryInteger.Words
in unconstrained generic constraints.
@moiseev
Copy link
Contributor

moiseev commented Jul 27, 2017

@swift-ci Please smoke test

@lorentey
Copy link
Member Author

I fixed the build time regression by relaxing the BinaryInteger.Words constraint to _Indexable.

To ensure words.count remains available in generic contexts, I moved Collection's count property up into _Indexable (along with isEmpty).

Updated build times: (incremental build-script -R on latest master)

before: 269.12 real      1091.76 user        47.95 sys
after:  274.38 real      1136.65 user        49.71 sys

@moiseev
Copy link
Contributor

moiseev commented Jul 28, 2017

@swift-ci Please test

@swiftlang swiftlang deleted a comment from swift-ci Jul 31, 2017
@swiftlang swiftlang deleted a comment from swift-ci Jul 31, 2017
@moiseev
Copy link
Contributor

moiseev commented Jul 31, 2017

FWIW, here are my local measurements of build time with and without the change applied:

before: 317.25s user 25.48s system 303% cpu 1:53.08 total
after: 340.38s user 26.32s system 301% cpu 2:01.79 total

before: 309.81s user 25.82s system 290% cpu 1:55.43 total
after: 343.30s user 26.98s system 287% cpu 2:08.89 total

Regression of about ~10%.

@lorentey
Copy link
Member Author

lorentey commented Aug 1, 2017

@moiseev Weird; I get consistently better ratios. (On an i7 rMBP with -j8, with the PR rebased onto current master.)

With Collection conformance:

Name real user sys
before 295.93 1234.35 64.31
after c809110 332.85 1380.12 68.63
Change 112% 112% 107%

With _Indexable:

Name real user sys
before 295.93 1234.35 64.31
after 11e30ed 304.44 1282.90 63.69
Change 103% 104% 99%

In any case, instance-level bitWidth is still in the BinaryInteger protocol, so people can continue to use that in generic contexts; it's not super important to make words.count available, too. I'm a-okay with closing this PR without a merge! (I'll keep monitoring compiler performance and resubmit if/when we can do this without a performance penalty.)

@moiseev
Copy link
Contributor

moiseev commented Aug 4, 2017

@lorentey what are you timing exactly? I just cannot explain why I see the difference and you don't =)

My procedure is essentially this:

utils/build-script -r --skip-build-benchmarks
find ./stdlib/public/core/* -name '*.swift*' -print0 | xargs -0 touch
time ninja -C ../build/Ninja-RelWithDebInfoAssert+stdlib-DebugAssert/swift-macosx-x86_64 swift-stdlib-macosx

What's yours?

I tried it again just now on my desktop with these results:


before 147.09s user 8.52s system 240% cpu 1:04.63 total
after 162.12s user 8.68s system 245% cpu 1:09.68 total

@lorentey
Copy link
Member Author

lorentey commented Aug 4, 2017

@moiseev Ah, that explains it! I just used time build-script -R, so my timings included the compilation time for benchmarks and overlays, too. 🐢 (Ninja compiled about 510 or so files, AFAICR.)

@lorentey
Copy link
Member Author

lorentey commented Nov 1, 2018

This is now obsolete; BinaryInteger.Words is constrained to RandomAccessCollection.

@lorentey lorentey closed this Nov 1, 2018
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