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

Implement SE-0065 "A New Model for Collections and Indices" #2108

Merged
merged 402 commits into from
Apr 27, 2016

Conversation

dabrahams
Copy link
Contributor

This pull request should not be merged until after the corresponding proposal has been reviewed and accepted.

gribozavr and others added 30 commits March 18, 2016 23:03
We need three index types, one for each traversal kind.
We need a slice type for every combination of collection protocols, so
that a collection's SubSequence preserves all operations available on
the collection itself.

We need three index types, one for each traversal kind.
…ittest

We are still hitting what looks like a compiler bug:

error: type alias 'SubSequence' circularly references itself

which is emitted for every minimal collection type.
This is required to forward the IndexDistance typealias in Slice* types.

Unfortunately, making this change required working around a compiler
bug, so I had to split Indexable into IndexableBase and Indexable.
It depends on checkRangeReplaceable, which was moved to
StdlibCollectionUnittest.
"type circularly references itself"
Algorithm and SequenceWrapperTest
I'm not too satisfied with the names for the updating: versions, but
this is a start.
This time, choose something that's at least compliant with the API
guidelines.
gribozavr and others added 9 commits April 25, 2016 11:44
rdar://problem/25666129 tracks reviewing these changes
<rdar://problem/25666028> swift-3-indexing-model: Generics/associated_self_constraints.swift
<rdar://problem/25665969> swift-3-indexing-model: Interpreter/protocol_extensions.swift fails
<rdar://problem/25890224> swift-3-indexing-model: TEST 'Swift :: NameBinding/reference-dependencies.swift' FAILED
There's no longer anything looking up any conformances on Int and
getting negative results. Previously this was in looking for viable
'~=' overloads for the 'case' on line 206, but that seems to be
ruled out by other means now. We still have CHECK lines for other
protocol conformance checks, so we're not losing coverage here.

rdar://problem/25890224
@gribozavr
Copy link
Contributor

@swift-ci Please benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (36)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
BitCount 1 29 +2797.2% 0.03x
StringWithCString 75586 356758 +372.0% 0.21x
PopFrontUnsafePointer 8606 25925 +201.2% 0.33x
ArrayValueProp3 5 14 +180.0% 0.36x
ArrayValueProp 5 14 +180.0% 0.36x
ArrayValueProp4 5 14 +180.0% 0.36x
ArrayValueProp2 5 14 +180.0% 0.36x
RC4 250 639 +155.6% 0.39x
Memset 222 462 +108.1% 0.48x
ObjectiveCBridgeFromNSArrayAnyObject 61375 100777 +64.2% 0.61x
ArrayAppendReserved 506 813 +60.7% 0.62x
ArrayAppend 727 1017 +39.9% 0.71x
ObjectiveCBridgeStubFromArrayOfNSString 109846 146908 +33.7% 0.75x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 159899 203730 +27.4% 0.78x
ObjectiveCBridgeFromNSArrayAnyObjectToString 157976 198771 +25.8% 0.79x
120 2262632 2746203 +21.4% 0.82x
RangeAssignment 270 327 +21.1% 0.83x
UTF8Decode 261 311 +19.2% 0.84x
NopDeinit 34629 40891 +18.1% 0.85x
StringInterpolation 10004 11591 +15.9% 0.86x
OpenClose 49 57 +16.3% 0.86x
StrToInt 4880 5586 +14.5% 0.87x
SetIsSubsetOf 550 624 +13.4% 0.88x
ProtocolDispatch 2895 3209 +10.8% 0.90x
StringHasPrefix 575 633 +10.1% 0.91x
MapReduce 325 359 +10.5% 0.91x
ClassArrayGetter 12 13 +8.3% 0.92x
Join 439 477 +8.7% 0.92x
PolymorphicCalls 61 66 +8.2% 0.92x
Walsh 318 345 +8.5% 0.92x
SetIsSubsetOf_OfObjects 614 664 +8.1% 0.92x
Chars 612 663 +8.3% 0.92x
CaptureProp 3745 4024 +7.5% 0.93x
DictionaryRemove 4841 5186 +7.1% 0.93x
Dictionary2 1908 2038 +6.8% 0.94x
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 101730 108088 +6.2% 0.94x

Improvement (5)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
Calculator 33 31 -6.1% 1.06x
Phonebook 7148 6682 -6.5% 1.07x
Hanoi 3409 3070 -9.9% 1.11x
SuperChars 275356 220529 -19.9% 1.25x
NSError 364 268 -26.4% 1.36x

No Changes (80)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
SortStrings 1732 1680 -3.0% 1.03x
StaticArray 2690 2632 -2.2% 1.02x(?)
DictionaryBridge 3543 3472 -2.0% 1.02x(?)
StringHasPrefixUnicode 15313 14973 -2.2% 1.02x
MonteCarloPi 42557 41715 -2.0% 1.02x
AngryPhonebook 3379 3348 -0.9% 1.01x(?)
Integrate 234 231 -1.3% 1.01x(?)
Histogram 639 634 -0.8% 1.01x
SortStringsUnicode 8928 8841 -1.0% 1.01x
DictionarySwapOfObjects 6675 6638 -0.6% 1.01x
ArrayInClass 85 84 -1.2% 1.01x
MonteCarloE 9979 9915 -0.6% 1.01x
ObjectiveCBridgeFromNSArrayAnyObjectForced 3655 3602 -1.4% 1.01x(?)
TypeFlood 0 0 +0.0% 1.00x
DictionarySwap 759 756 -0.4% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
ArrayOfGenericPOD 208 207 -0.5% 1.00x
StackPromo 18717 18725 +0.0% 1.00x(?)
RGBHistogramOfObjects 21275 21333 +0.3% 1.00x(?)
RecursiveOwnedParameter 1837 1831 -0.3% 1.00x
DeadArray 172 172 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObjectForced 4008 4001 -0.2% 1.00x(?)
LinkedList 6850 6823 -0.4% 1.00x(?)
StringHasSuffixUnicode 61911 61739 -0.3% 1.00x(?)
Array2D 1977 1976 -0.1% 1.00x(?)
ObjectiveCBridgeStubFromNSStringRef 326 327 +0.3% 1.00x
SetIntersect 1303 1306 +0.2% 1.00x(?)
SetIntersect_OfObjects 2366 2361 -0.2% 1.00x(?)
ArrayOfRef 3442 3440 -0.1% 1.00x(?)
ByteSwap 1 1 +0.0% 1.00x
ObjectAllocation 141 141 +0.0% 1.00x
XorLoop 359 360 +0.3% 1.00x
StringWalk 5971 6009 +0.6% 0.99x(?)
ObjectiveCBridgeStubToNSString 1367 1375 +0.6% 0.99x
ObjectiveCBridgeFromNSSetAnyObject 94835 95548 +0.8% 0.99x(?)
ArrayOfPOD 171 172 +0.6% 0.99x
SetUnion 3425 3451 +0.8% 0.99x
Dictionary 732 739 +1.0% 0.99x(?)
SetExclusiveOr 3878 3931 +1.4% 0.99x
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 4496 4558 +1.4% 0.99x(?)
ErrorHandling 2853 2874 +0.7% 0.99x(?)
ArrayLiteral 976 989 +1.3% 0.99x
StringBuilder 1389 1400 +0.8% 0.99x
ArrayOfGenericRef 3465 3495 +0.9% 0.99x(?)
StringHasSuffix 708 714 +0.8% 0.99x(?)
ObjectiveCBridgeFromNSString 1540 1549 +0.6% 0.99x(?)
Prims 713 717 +0.6% 0.99x
SortLettersInPlace 952 962 +1.1% 0.99x
PopFrontArrayGeneric 1052 1068 +1.5% 0.99x
StringEqualPointerComparison 7084 7163 +1.1% 0.99x
HashTest 1805 1831 +1.4% 0.99x
SevenBoom 1274 1290 +1.3% 0.99x(?)
ObjectiveCBridgeFromNSStringForced 2150 2172 +1.0% 0.99x(?)
ObjectiveCBridgeToNSString 1017 1043 +2.6% 0.98x
DictionaryRemoveOfObjects 19432 19728 +1.5% 0.98x
ObjectiveCBridgeStubFromNSString 690 701 +1.6% 0.98x(?)
ProtocolDispatch2 150 153 +2.0% 0.98x
NSDictionaryCastToSwift 8531 8699 +2.0% 0.98x
DictionaryOfObjects 2199 2250 +2.3% 0.98x
PopFrontArray 1058 1076 +1.7% 0.98x
Dictionary3OfObjects 849 862 +1.5% 0.98x
ObjectiveCBridgeToNSSet 16201 16616 +2.6% 0.98x(?)
NSStringConversion 579 594 +2.6% 0.97x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 181668 186677 +2.8% 0.97x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 115876 119592 +3.2% 0.97x
RGBHistogram 3228 3322 +2.9% 0.97x
DictionaryLiteral 2929 3030 +3.5% 0.97x(?)
Sim2DArray 361 374 +3.6% 0.97x
ArraySubscript 1322 1375 +4.0% 0.96x
ObjectiveCBridgeStubToArrayOfNSString 30306 31699 +4.6% 0.96x(?)
Dictionary3 505 525 +4.0% 0.96x
StrComplexWalk 3018 3159 +4.7% 0.96x
ObjectiveCBridgeFromNSSetAnyObjectToString 166652 173367 +4.0% 0.96x
ObjectiveCBridgeToNSArray 29962 31053 +3.6% 0.96x
SetExclusiveOr_OfObjects 7862 8205 +4.4% 0.96x
Dictionary2OfObjects 3273 3415 +4.3% 0.96x
TwoSum 1638 1708 +4.3% 0.96x
ObjectiveCBridgeFromNSDictionaryAnyObject 185367 194369 +4.9% 0.95x
ObjectiveCBridgeToNSDictionary 15996 16888 +5.6% 0.95x(?)
SetUnion_OfObjects 6579 6907 +5.0% 0.95x
**Unoptimized (Onone)**

Regression (30)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StringWithCString 73830 738697 +900.5% 0.10x
RangeAssignment 12798 67202 +425.1% 0.19x
UTF8Decode 38007 89954 +136.7% 0.42x
MapReduce 41692 95843 +129.9% 0.44x
CaptureProp 53761 114600 +113.2% 0.47x
PopFrontArray 11522 23928 +107.7% 0.48x
Join 1336 2553 +91.1% 0.52x
ObjectiveCBridgeFromNSArrayAnyObject 65812 107223 +62.9% 0.61x
DictionaryLiteral 20112 29652 +47.4% 0.68x
MonteCarloE 106328 156535 +47.2% 0.68x
RGBHistogram 65548 96762 +47.6% 0.68x
SortLettersInPlace 4131 5893 +42.6% 0.70x
Histogram 13482 18314 +35.8% 0.74x
Phonebook 86045 112649 +30.9% 0.76x
ObjectiveCBridgeStubFromArrayOfNSString 111046 147037 +32.4% 0.76x
RGBHistogramOfObjects 114457 146619 +28.1% 0.78x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 162722 209343 +28.6% 0.78x
StaticArray 17100 20975 +22.7% 0.82x
ObjectiveCBridgeFromNSArrayAnyObjectToString 168241 203765 +21.1% 0.83x
120 5273250 6268698 +18.9% 0.84x
PopFrontUnsafePointer 95386 111780 +17.2% 0.85x
ArrayOfPOD 2095 2394 +14.3% 0.88x
ByteSwap 9 10 +11.1% 0.90x
ArrayAppend 2689 2992 +11.3% 0.90x
Memset 18644 20642 +10.7% 0.90x
StringInterpolation 15254 16753 +9.8% 0.91x
Sim2DArray 13160 14361 +9.1% 0.92x
ObjectiveCBridgeFromNSSetAnyObjectForced 7531 8127 +7.9% 0.93x
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 113026 119801 +6.0% 0.94x(?)
ArrayValueProp4 2453 2619 +6.8% 0.94x(?)

Improvement (18)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ProtocolDispatch 5610 5276 -6.0% 1.06x
TypeFlood 147 138 -6.1% 1.07x(?)
PopFrontArrayGeneric 11733 10971 -6.5% 1.07x
Calculator 1004 912 -9.2% 1.10x
HashTest 6149 5507 -10.4% 1.12x
DictionaryOfObjects 6889 5549 -19.4% 1.24x
SuperChars 717180 543244 -24.2% 1.32x
Dictionary 4126 2785 -32.5% 1.48x
AngryPhonebook 6089 4088 -32.9% 1.49x
ErrorHandling 7106 3897 -45.2% 1.82x
StringWalk 50006 26792 -46.4% 1.87x
SortStringsUnicode 22618 11351 -49.8% 1.99x
ObjectAllocation 1279 528 -58.7% 2.42x
StrToInt 18185 6711 -63.1% 2.71x
StringBuilder 8173 2967 -63.7% 2.75x
SortStrings 13745 3736 -72.8% 3.68x
ArrayValueProp2 17813 2743 -84.6% 6.49x
Chars 52810 5280 -90.0% 10.00x

No Changes (73)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StrComplexWalk 8488 8109 -4.5% 1.05x
StringHasPrefix 1554 1483 -4.6% 1.05x
NopDeinit 61168 58800 -3.9% 1.04x
StringHasPrefixUnicode 16306 15979 -2.0% 1.02x
OpenClose 472 461 -2.3% 1.02x(?)
StringHasSuffixUnicode 64063 62859 -1.9% 1.02x(?)
Hanoi 19030 18712 -1.7% 1.02x
MonteCarloPi 50457 49331 -2.2% 1.02x
ArrayValueProp 2204 2192 -0.5% 1.01x(?)
StringHasSuffix 1539 1518 -1.4% 1.01x(?)
StackPromo 161644 160148 -0.9% 1.01x(?)
StringEqualPointerComparison 9501 9391 -1.2% 1.01x(?)
SetIsSubsetOf_OfObjects 2873 2857 -0.6% 1.01x(?)
GlobalClass 0 0 +0.0% 1.00x
ObjectiveCBridgeStubToNSString 1670 1668 -0.1% 1.00x(?)
RecursiveOwnedParameter 7599 7617 +0.2% 1.00x(?)
ObjectiveCBridgeStubFromNSStringRef 651 651 +0.0% 1.00x
LinkedList 26125 26247 +0.5% 1.00x(?)
DictionarySwap 11105 11110 +0.1% 1.00x(?)
SetIsSubsetOf 2971 2977 +0.2% 1.00x(?)
ClassArrayGetter 1182 1184 +0.2% 1.00x(?)
Array2D 759156 760074 +0.1% 1.00x
SetIntersect 19007 19013 +0.0% 1.00x(?)
SetIntersect_OfObjects 18935 18853 -0.4% 1.00x(?)
DictionarySwapOfObjects 25395 25359 -0.1% 1.00x(?)
ArrayOfGenericRef 9481 9436 -0.5% 1.00x
PolymorphicCalls 1157 1156 -0.1% 1.00x(?)
RC4 8426 8450 +0.3% 1.00x(?)
NSError 644 653 +1.4% 0.99x
ArraySubscript 5208 5256 +0.9% 0.99x
ProtocolDispatch2 425 430 +1.2% 0.99x
SetExclusiveOr 49217 49569 +0.7% 0.99x(?)
Dictionary3 2029 2042 +0.6% 0.99x(?)
ArrayOfRef 8801 8899 +1.1% 0.99x
SevenBoom 1427 1445 +1.3% 0.99x
SetExclusiveOr_OfObjects 67362 68271 +1.4% 0.99x
ObjectiveCBridgeToNSDictionary 16887 17122 +1.4% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 196938 199299 +1.2% 0.99x(?)
Dictionary3OfObjects 2662 2683 +0.8% 0.99x(?)
DictionaryRemoveOfObjects 60435 61377 +1.6% 0.98x
ObjectiveCBridgeStubFromNSString 1110 1133 +2.1% 0.98x
SetUnion 35202 35922 +2.0% 0.98x
ObjectiveCBridgeFromNSSetAnyObject 102324 104415 +2.0% 0.98x
DictionaryBridge 3586 3646 +1.7% 0.98x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7117 7241 +1.7% 0.98x(?)
NSDictionaryCastToSwift 9790 9998 +2.1% 0.98x
ObjectiveCBridgeFromNSSetAnyObjectToString 181319 185914 +2.5% 0.98x(?)
ArrayLiteral 1027 1045 +1.8% 0.98x
ArrayInClass 3562 3647 +2.4% 0.98x
ObjectiveCBridgeFromNSStringForced 2521 2562 +1.6% 0.98x(?)
ObjectiveCBridgeFromNSString 4908 4989 +1.6% 0.98x
SetUnion_OfObjects 51665 52624 +1.9% 0.98x
ArrayAppendReserved 2635 2690 +2.1% 0.98x
TwoSum 9352 9525 +1.9% 0.98x(?)
Walsh 11862 12123 +2.2% 0.98x
ObjectiveCBridgeToNSString 1044 1071 +2.6% 0.97x
NSStringConversion 2582 2674 +3.6% 0.97x(?)
Integrate 345 355 +2.9% 0.97x
BitCount 88 91 +3.4% 0.97x
ObjectiveCBridgeToNSArray 30248 31237 +3.3% 0.97x
Prims 14128 14583 +3.2% 0.97x
Dictionary2OfObjects 6821 7017 +2.9% 0.97x
DictionaryRemove 30112 31048 +3.1% 0.97x
XorLoop 18015 18538 +2.9% 0.97x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 190353 198124 +4.1% 0.96x(?)
ObjectiveCBridgeStubToArrayOfNSString 30572 31929 +4.4% 0.96x
Dictionary2 5090 5304 +4.2% 0.96x
ObjectiveCBridgeFromNSArrayAnyObjectForced 6907 7172 +3.8% 0.96x
ObjectiveCBridgeToNSSet 15724 16451 +4.6% 0.96x(?)
ArrayOfGenericPOD 3338 3531 +5.8% 0.95x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 123183 129669 +5.3% 0.95x(?)
DeadArray 134108 141210 +5.3% 0.95x
ArrayValueProp3 2512 2652 +5.6% 0.95x
**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

@gribozavr
Copy link
Contributor

Let's do a second run:

@swift-ci Please benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (36)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
BitCount 1 31 +2997.0% 0.03x
StringWithCString 80017 377923 +372.3% 0.21x
PopFrontUnsafePointer 9116 27216 +198.6% 0.33x
RC4 267 678 +153.9% 0.39x
ArrayValueProp3 6 15 +150.0% 0.40x
ArrayValueProp 6 15 +150.0% 0.40x
ArrayValueProp4 6 15 +150.0% 0.40x
ArrayValueProp2 6 15 +150.0% 0.40x
Memset 235 489 +108.1% 0.48x
ObjectiveCBridgeFromNSArrayAnyObject 65751 105089 +59.8% 0.63x
ArrayAppendReserved 536 852 +59.0% 0.63x
ArrayAppend 773 1077 +39.3% 0.72x
ObjectiveCBridgeStubFromArrayOfNSString 113484 151574 +33.6% 0.75x
ObjectiveCBridgeFromNSArrayAnyObjectToString 175156 215471 +23.0% 0.81x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 166962 207184 +24.1% 0.81x
RangeAssignment 284 348 +22.5% 0.82x
UTF8Decode 275 328 +19.3% 0.84x
120 2446269 2896914 +18.4% 0.84x
OpenClose 51 60 +17.6% 0.85x
NopDeinit 36667 42769 +16.6% 0.86x
SetIsSubsetOf 579 662 +14.3% 0.87x
StringInterpolation 10717 12128 +13.2% 0.88x
StrToInt 5141 5872 +14.2% 0.88x
ProtocolDispatch 3042 3345 +10.0% 0.91x
StringHasPrefix 609 670 +10.0% 0.91x
Chars 633 695 +9.8% 0.91x
Join 467 505 +8.1% 0.92x
MapReduce 342 373 +9.1% 0.92x
Walsh 330 359 +8.8% 0.92x
CaptureProp 3966 4263 +7.5% 0.93x
SetIsSubsetOf_OfObjects 654 701 +7.2% 0.93x
DictionaryRemove 5036 5404 +7.3% 0.93x
StrComplexWalk 3174 3368 +6.1% 0.94x
Dictionary2 2025 2159 +6.6% 0.94x
PolymorphicCalls 65 69 +6.2% 0.94x
DictionaryLiteral 3131 3318 +6.0% 0.94x

Improvement (6)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
Calculator 35 33 -5.7% 1.06x
Phonebook 7545 7077 -6.2% 1.07x
SuperChars 291855 263109 -9.8% 1.11x
Hanoi 3609 3254 -9.8% 1.11x
SetIntersect 1724 1377 -20.1% 1.25x
NSError 383 283 -26.1% 1.35x

No Changes (79)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ErrorHandling 3083 2971 -3.6% 1.04x
StringHasPrefixUnicode 16130 15612 -3.2% 1.03x
SortStrings 1837 1777 -3.3% 1.03x
SortStringsUnicode 9403 9229 -1.9% 1.02x
ObjectiveCBridgeFromNSSetAnyObject 100595 98915 -1.7% 1.02x(?)
MonteCarloPi 45056 44184 -1.9% 1.02x
MonteCarloE 10584 10513 -0.7% 1.01x
ArrayInClass 87 86 -1.1% 1.01x
Histogram 677 672 -0.7% 1.01x
RecursiveOwnedParameter 1948 1937 -0.6% 1.01x
StringHasSuffixUnicode 64735 64297 -0.7% 1.01x(?)
StaticArray 2778 2749 -1.0% 1.01x
Array2D 2020 1998 -1.1% 1.01x(?)
LinkedList 7255 7254 -0.0% 1.00x(?)
PopFrontArray 1105 1109 +0.4% 1.00x(?)
DictionarySwapOfObjects 6961 6939 -0.3% 1.00x(?)
StringHasSuffix 744 747 +0.4% 1.00x(?)
StackPromo 19836 19839 +0.0% 1.00x(?)
Integrate 238 238 +0.0% 1.00x
RGBHistogramOfObjects 22626 22684 +0.3% 1.00x(?)
ObjectiveCBridgeStubToNSString 1443 1447 +0.3% 1.00x(?)
ObjectiveCBridgeStubFromNSStringRef 346 346 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObjectForced 4176 4163 -0.3% 1.00x(?)
ObjectiveCBridgeStubFromNSString 721 724 +0.4% 1.00x(?)
AngryPhonebook 3446 3449 +0.1% 1.00x(?)
SetIntersect_OfObjects 2502 2500 -0.1% 1.00x
DeadArray 182 182 +0.0% 1.00x
ByteSwap 1 1 +0.0% 1.00x
StringEqualPointerComparison 7305 7295 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 3812 3813 +0.0% 1.00x(?)
StringWalk 6295 6313 +0.3% 1.00x
ArrayOfPOD 182 182 +0.0% 1.00x
DictionarySwap 797 797 +0.0% 1.00x
ObjectiveCBridgeFromNSString 1600 1596 -0.2% 1.00x(?)
TypeFlood 0 0 +0.0% 1.00x
ArrayOfGenericPOD 220 220 +0.0% 1.00x
ClassArrayGetter 14 14 +0.0% 1.00x
ObjectiveCBridgeToNSDictionary 17438 17461 +0.1% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
XorLoop 380 381 +0.3% 1.00x
ObjectiveCBridgeToNSString 1072 1078 +0.6% 0.99x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 192975 195633 +1.4% 0.99x(?)
ObjectAllocation 149 150 +0.7% 0.99x(?)
SetUnion 3611 3637 +0.7% 0.99x
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 4791 4853 +1.3% 0.99x(?)
ArrayOfRef 3597 3631 +0.9% 0.99x
StringBuilder 1473 1483 +0.7% 0.99x
ObjectiveCBridgeToNSArray 31705 32157 +1.4% 0.99x
Prims 755 762 +0.9% 0.99x
SortLettersInPlace 1009 1022 +1.3% 0.99x
PopFrontArrayGeneric 1098 1108 +0.9% 0.99x
DictionaryRemoveOfObjects 20625 20918 +1.4% 0.99x
Dictionary3OfObjects 903 914 +1.2% 0.99x
HashTest 1909 1921 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSStringForced 2226 2241 +0.7% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 197366 200988 +1.8% 0.98x(?)
NSStringConversion 618 629 +1.8% 0.98x
RGBHistogram 3438 3505 +1.9% 0.98x(?)
Dictionary 775 787 +1.6% 0.98x(?)
ProtocolDispatch2 157 160 +1.9% 0.98x
SetExclusiveOr 4157 4249 +2.2% 0.98x
NSDictionaryCastToSwift 9063 9214 +1.7% 0.98x
ObjectiveCBridgeFromNSSetAnyObjectToString 178666 181986 +1.9% 0.98x
ArrayOfGenericRef 3636 3707 +1.9% 0.98x
Sim2DArray 376 384 +2.1% 0.98x
SevenBoom 1345 1370 +1.9% 0.98x
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 108151 111363 +3.0% 0.97x(?)
ObjectiveCBridgeStubToArrayOfNSString 31847 32903 +3.3% 0.97x
DictionaryBridge 3639 3747 +3.0% 0.97x(?)
ArrayLiteral 1033 1061 +2.7% 0.97x
SetExclusiveOr_OfObjects 8368 8653 +3.4% 0.97x
TwoSum 1743 1794 +2.9% 0.97x
ObjectiveCBridgeToNSSet 16836 17396 +3.3% 0.97x
DictionaryOfObjects 2307 2392 +3.7% 0.96x
Dictionary2OfObjects 3464 3608 +4.2% 0.96x
ArraySubscript 1395 1473 +5.6% 0.95x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 120280 125990 +4.8% 0.95x(?)
Dictionary3 525 555 +5.7% 0.95x
SetUnion_OfObjects 6985 7363 +5.4% 0.95x
**Unoptimized (Onone)**

Regression (27)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StringWithCString 78154 782291 +901.0% 0.10x
RangeAssignment 13530 69778 +415.7% 0.19x
UTF8Decode 40307 95406 +136.7% 0.42x
MapReduce 44133 101353 +129.7% 0.44x
CaptureProp 56436 118624 +110.2% 0.48x
PopFrontArray 12179 24563 +101.7% 0.50x
Join 1402 2685 +91.5% 0.52x
ObjectiveCBridgeFromNSArrayAnyObject 69546 109271 +57.1% 0.64x
RGBHistogram 68770 101982 +48.3% 0.67x
DictionaryLiteral 21222 31079 +46.5% 0.68x
MonteCarloE 112681 165812 +47.1% 0.68x
SortLettersInPlace 4321 6141 +42.1% 0.70x
Histogram 14352 19339 +34.8% 0.74x
ObjectiveCBridgeStubFromArrayOfNSString 111286 150976 +35.7% 0.74x
Phonebook 87630 114377 +30.5% 0.77x
RGBHistogramOfObjects 121086 155079 +28.1% 0.78x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 169590 217832 +28.4% 0.78x
ObjectiveCBridgeFromNSArrayAnyObjectToString 166488 208030 +24.9% 0.80x
StaticArray 18003 21796 +21.1% 0.83x
120 5528408 6511994 +17.8% 0.85x
PopFrontUnsafePointer 98737 114624 +16.1% 0.86x
ArrayAppend 2776 3084 +11.1% 0.90x
ArrayOfPOD 2264 2520 +11.3% 0.90x
Memset 19738 21865 +10.8% 0.90x
StringInterpolation 16020 17559 +9.6% 0.91x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 194670 210888 +8.3% 0.92x
Sim2DArray 13937 15214 +9.2% 0.92x

Improvement (18)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
NopDeinit 64625 60122 -7.0% 1.07x
ProtocolDispatch 5780 5315 -8.0% 1.09x
PopFrontArrayGeneric 12411 11312 -8.9% 1.10x
Calculator 1069 966 -9.6% 1.11x
HashTest 6503 5828 -10.4% 1.12x
DictionaryOfObjects 7284 5786 -20.6% 1.26x
SuperChars 753734 575288 -23.7% 1.31x
Dictionary 4377 2950 -32.6% 1.48x
AngryPhonebook 6485 4334 -33.2% 1.50x
ErrorHandling 7532 4052 -46.2% 1.86x
SortStringsUnicode 23479 11817 -49.7% 1.99x
StringWalk 52974 23077 -56.4% 2.30x
ObjectAllocation 1351 559 -58.6% 2.42x
StrToInt 19254 6989 -63.7% 2.75x
StringBuilder 8626 3100 -64.1% 2.78x
SortStrings 14177 3924 -72.3% 3.61x
ArrayValueProp2 18870 2885 -84.7% 6.54x
Chars 56536 5413 -90.4% 10.44x

No Changes (76)

TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StrComplexWalk 8865 8430 -4.9% 1.05x
StringHasPrefix 1626 1542 -5.2% 1.05x
OpenClose 481 464 -3.5% 1.04x
StringHasPrefixUnicode 16951 16659 -1.7% 1.02x
StringHasSuffix 1586 1560 -1.6% 1.02x
StringEqualPointerComparison 9797 9591 -2.1% 1.02x
Hanoi 20253 19812 -2.2% 1.02x
MonteCarloPi 53514 52284 -2.3% 1.02x
Integrate 361 358 -0.8% 1.01x
SetIsSubsetOf 3169 3149 -0.6% 1.01x
StringHasSuffixUnicode 65740 65362 -0.6% 1.01x
NSDictionaryCastToSwift 10145 10048 -1.0% 1.01x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7549 7510 -0.5% 1.01x(?)
PolymorphicCalls 1172 1159 -1.1% 1.01x
ArraySubscript 5499 5512 +0.2% 1.00x
GlobalClass 0 0 +0.0% 1.00x
ArrayValueProp 2293 2292 -0.0% 1.00x(?)
ObjectiveCBridgeStubToNSString 1767 1768 +0.1% 1.00x(?)
RecursiveOwnedParameter 8088 8104 +0.2% 1.00x(?)
ObjectiveCBridgeStubFromNSStringRef 690 691 +0.1% 1.00x
NSError 690 690 +0.0% 1.00x
ObjectiveCBridgeToNSDictionary 17378 17331 -0.3% 1.00x(?)
ClassArrayGetter 1254 1254 +0.0% 1.00x
Array2D 804373 805906 +0.2% 1.00x
DictionarySwapOfObjects 26799 26859 +0.2% 1.00x(?)
SetIntersect_OfObjects 20074 19988 -0.4% 1.00x
RC4 8939 8956 +0.2% 1.00x(?)
ByteSwap 10 10 +0.0% 1.00x
DictionarySwap 11759 11760 +0.0% 1.00x(?)
SevenBoom 1522 1520 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 7322 7342 +0.3% 1.00x(?)
SetIsSubsetOf_OfObjects 3033 3042 +0.3% 1.00x(?)
LinkedList 27675 27847 +0.6% 0.99x(?)
ObjectiveCBridgeToNSString 1101 1117 +1.4% 0.99x
ObjectiveCBridgeStubFromNSString 1157 1172 +1.3% 0.99x
ObjectiveCBridgeStubToArrayOfNSString 32428 32744 +1.0% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObject 104934 105967 +1.0% 0.99x(?)
SetIntersect 20151 20279 +0.6% 0.99x
DictionaryBridge 3767 3786 +0.5% 0.99x(?)
Dictionary3 2152 2166 +0.7% 0.99x
ArrayOfRef 9317 9428 +1.2% 0.99x
BitCount 91 92 +1.1% 0.99x
ArrayLiteral 1090 1105 +1.4% 0.99x
ArrayOfGenericRef 10003 10093 +0.9% 0.99x
ArrayAppendReserved 2696 2710 +0.5% 0.99x
Dictionary3OfObjects 2811 2836 +0.9% 0.99x(?)
TwoSum 9913 10063 +1.5% 0.99x
ObjectiveCBridgeToNSSet 16917 17103 +1.1% 0.99x(?)
NSStringConversion 2717 2765 +1.8% 0.98x
ObjectiveCBridgeFromNSSetAnyObjectForced 7796 7975 +2.3% 0.98x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 131799 133920 +1.6% 0.98x
SetExclusiveOr 51875 52774 +1.7% 0.98x
ArrayInClass 3776 3864 +2.3% 0.98x
ObjectiveCBridgeFromNSString 5075 5156 +1.6% 0.98x(?)
ObjectiveCBridgeFromNSStringForced 2609 2657 +1.8% 0.98x(?)
ObjectiveCBridgeToNSArray 31857 32589 +2.3% 0.98x(?)
SetExclusiveOr_OfObjects 71150 72277 +1.6% 0.98x
SetUnion 37570 38270 +1.9% 0.98x
DictionaryRemoveOfObjects 64039 65066 +1.6% 0.98x(?)
SetUnion_OfObjects 54459 55836 +2.5% 0.98x
Walsh 12532 12777 +1.9% 0.98x
DictionaryRemove 32014 32769 +2.4% 0.98x
StackPromo 168203 173086 +2.9% 0.97x
ObjectiveCBridgeFromNSDictionaryAnyObject 204274 209781 +2.7% 0.97x(?)
TypeFlood 155 159 +2.6% 0.97x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 187180 193403 +3.3% 0.97x(?)
DeadArray 143451 148185 +3.3% 0.97x
Prims 14969 15407 +2.9% 0.97x
Dictionary2OfObjects 7248 7439 +2.6% 0.97x
XorLoop 19101 19641 +2.8% 0.97x
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 116644 121957 +4.5% 0.96x
ProtocolDispatch2 438 455 +3.9% 0.96x
Dictionary2 5378 5617 +4.4% 0.96x
ArrayValueProp3 2639 2745 +4.0% 0.96x
ArrayOfGenericPOD 3513 3698 +5.3% 0.95x
ArrayValueProp4 2568 2707 +5.4% 0.95x
**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

@gribozavr gribozavr changed the title Swift 3 Indexing Model (for evolution review) Implement SE-0065 "A New Model for Collections and Indices" Apr 27, 2016
natecook1000 and others added 3 commits April 27, 2016 10:56
- A benchmark method was renamed during the Set API batch revisions
- The SourceKit test that includes stdlib docs needed a new fixture
@gribozavr gribozavr merged commit daea3f6 into master Apr 27, 2016
@gribozavr gribozavr deleted the swift-3-indexing-model branch April 27, 2016 18:15
@eeckstein
Copy link
Contributor

Beside the performance regressions, I see a 30% increase in code size on the stdlib dylib.

MaxDesiatov pushed a commit that referenced this pull request Apr 19, 2021
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.