-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Optional codegen improvements #2942
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
Optional codegen improvements #2942
Conversation
@swift-ci Please test and merge |
Are you sure there are no -Onone regressions here? Michael
|
I'd only expect improvements. This has the net effect of eliminating loads and stores from Onone code. We can revert if there are regressions. |
5624c07
to
c9ba2bf
Compare
We already have detailed knowledge of Optional's layout in SILGen, so these intrinsics were almost unused. They were only used in a few obscure places by some optional-to-bool conversions, used by 'is [A]' collection tests and the codegen for 'lazy' properties. Change these over to generate an EnumIsCaseExpr that we can directly lower to a 'select_enum' instruction in SILGen, leading to better codegen and obviating the need for these intrinsic functions.
@swift-ci Please test |
…tional. Being generic, the '_unwrapped' intrinsics force trafficking through memory, and while they're transparent so always get inlined, we don't do memory promotion in -Onone. Emitting the branch inline lets loadable optionals stay values leading to better -Onone codegen. (It also lets us throw away a surprising amount of support code for these optional intrinsics.)
@swift-ci Please benchmark |
Awesome, Joe! |
Build comment file:Optimized (O)
|
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
ObjectiveCBridgeFromNSArrayAnyObject | 66009 | 70226 | +6.4% | 0.94x |
Improvement (3)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
ObjectiveCBridgeStubFromArrayOfNSString | 123543 | 117055 | -5.2% | 1.06x |
ObjectiveCBridgeFromNSArrayAnyObjectToString | 190563 | 176834 | -7.2% | 1.08x(?) |
ClassArrayGetter | 13 | 12 | -7.7% | 1.08x |
No Changes (117)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
PopFrontUnsafePointer | 9229 | 8787 | -4.8% | 1.05x(?) |
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced | 183121 | 174761 | -4.6% | 1.05x |
StaticArray | 2711 | 2636 | -2.8% | 1.03x(?) |
AngryPhonebook | 2909 | 2834 | -2.6% | 1.03x(?) |
ObjectiveCBridgeStubFromNSStringRef | 132 | 130 | -1.5% | 1.02x(?) |
HashTest | 2015 | 1978 | -1.8% | 1.02x(?) |
ArrayInClass | 83 | 81 | -2.4% | 1.02x(?) |
Sim2DArray | 436 | 428 | -1.8% | 1.02x(?) |
StringHasPrefixUnicode | 15688 | 15353 | -2.1% | 1.02x(?) |
ObjectiveCBridgeFromNSSetAnyObjectToString | 166178 | 163301 | -1.7% | 1.02x(?) |
TwoSum | 1924 | 1885 | -2.0% | 1.02x(?) |
ArraySubscript | 1366 | 1353 | -0.9% | 1.01x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObject | 248808 | 246183 | -1.1% | 1.01x(?) |
StringHasPrefix | 651 | 644 | -1.1% | 1.01x(?) |
ObjectiveCBridgeStubToNSString | 1267 | 1259 | -0.6% | 1.01x(?) |
ProtocolDispatch | 2978 | 2963 | -0.5% | 1.01x |
StringHasSuffixUnicode | 64595 | 63904 | -1.1% | 1.01x(?) |
ObjectiveCBridgeFromNSSetAnyObject | 112462 | 111503 | -0.8% | 1.01x(?) |
ProtocolDispatch2 | 155 | 153 | -1.3% | 1.01x(?) |
Dictionary3 | 542 | 539 | -0.6% | 1.01x(?) |
ObjectiveCBridgeToNSArray | 31482 | 31228 | -0.8% | 1.01x(?) |
PopFrontArrayGeneric | 1162 | 1151 | -0.9% | 1.01x(?) |
DictionaryLiteral | 4436 | 4400 | -0.8% | 1.01x |
ObjectiveCBridgeStubToArrayOfNSString | 32048 | 31745 | -0.9% | 1.01x(?) |
Phonebook | 7255 | 7205 | -0.7% | 1.01x(?) |
SetUnion_OfObjects | 7078 | 7005 | -1.0% | 1.01x(?) |
RGBHistogram | 3118 | 3091 | -0.9% | 1.01x(?) |
ObjectiveCBridgeFromNSSetAnyObjectForced | 4125 | 4102 | -0.6% | 1.01x(?) |
SetUnion | 3283 | 3245 | -1.2% | 1.01x(?) |
StringHasSuffix | 662 | 653 | -1.4% | 1.01x(?) |
ObjectiveCBridgeToNSString | 1064 | 1059 | -0.5% | 1.00x(?) |
DictionarySwapOfObjects | 6721 | 6741 | +0.3% | 1.00x(?) |
StackPromo | 18942 | 18893 | -0.3% | 1.00x(?) |
PopFrontArray | 1194 | 1196 | +0.2% | 1.00x(?) |
RecursiveOwnedParameter | 1828 | 1830 | +0.1% | 1.00x(?) |
Integrate | 240 | 241 | +0.4% | 1.00x(?) |
SortStrings | 1793 | 1802 | +0.5% | 1.00x(?) |
MonteCarloPi | 42689 | 42665 | -0.1% | 1.00x(?) |
ObjectiveCBridgeFromNSArrayAnyObjectForced | 3735 | 3735 | +0.0% | 1.00x |
ObjectiveCBridgeFromNSStringForced | 2268 | 2257 | -0.5% | 1.00x(?) |
ArrayOfGenericPOD | 207 | 208 | +0.5% | 1.00x |
Dictionary3OfObjects | 880 | 876 | -0.5% | 1.00x(?) |
RangeAssignment | 325 | 326 | +0.3% | 1.00x(?) |
ByteSwap | 1 | 1 | +0.0% | 1.00x |
XorLoop | 361 | 360 | -0.3% | 1.00x(?) |
StringInterpolation | 11394 | 11369 | -0.2% | 1.00x(?) |
ErrorHandling | 3043 | 3034 | -0.3% | 1.00x(?) |
ObjectAllocation | 147 | 147 | +0.0% | 1.00x |
TypeFlood | 0 | 0 | +0.0% | 1.00x |
Dictionary2 | 1906 | 1899 | -0.4% | 1.00x(?) |
SetIntersect_OfObjects | 2354 | 2363 | +0.4% | 1.00x |
Join | 453 | 452 | -0.2% | 1.00x(?) |
ArrayOfRef | 3525 | 3527 | +0.1% | 1.00x(?) |
NSError | 330 | 330 | +0.0% | 1.00x |
PolymorphicCalls | 61 | 61 | +0.0% | 1.00x |
Calculator | 34 | 34 | +0.0% | 1.00x |
Hanoi | 3326 | 3338 | +0.4% | 1.00x(?) |
OpenClose | 50 | 50 | +0.0% | 1.00x |
DictionaryRemoveOfObjects | 19751 | 19827 | +0.4% | 1.00x(?) |
SetIsSubsetOf | 487 | 487 | +0.0% | 1.00x |
RGBHistogramOfObjects | 21923 | 22000 | +0.3% | 1.00x(?) |
StringBuilder | 1520 | 1522 | +0.1% | 1.00x(?) |
ArrayOfGenericRef | 3593 | 3602 | +0.2% | 1.00x(?) |
SetExclusiveOr_OfObjects | 8409 | 8419 | +0.1% | 1.00x(?) |
ObjectiveCBridgeToNSDictionary | 16980 | 16929 | -0.3% | 1.00x(?) |
RC4 | 253 | 253 | +0.0% | 1.00x |
Walsh | 338 | 339 | +0.3% | 1.00x(?) |
SetIsSubsetOf_OfObjects | 613 | 613 | +0.0% | 1.00x |
ArrayAppend | 739 | 738 | -0.1% | 1.00x(?) |
DictionaryRemove | 5016 | 4998 | -0.4% | 1.00x(?) |
ObjectiveCBridgeFromNSSetAnyObjectToStringForced | 119121 | 119210 | +0.1% | 1.00x(?) |
ArrayAppendReserved | 524 | 522 | -0.4% | 1.00x(?) |
ArrayOfPOD | 171 | 171 | +0.0% | 1.00x |
Chars | 651 | 653 | +0.3% | 1.00x(?) |
StrToInt | 5784 | 5769 | -0.3% | 1.00x(?) |
BitCount | 1 | 1 | +0.0% | 1.00x |
ArrayLiteral | 1015 | 1011 | -0.4% | 1.00x(?) |
StringWalk | 6174 | 6192 | +0.3% | 1.00x(?) |
ArrayValueProp | 5 | 5 | +0.0% | 1.00x |
StringWithCString | 587195 | 587440 | +0.0% | 1.00x(?) |
GlobalClass | 0 | 0 | +0.0% | 1.00x |
Memset | 222 | 223 | +0.5% | 1.00x |
Dictionary2OfObjects | 3332 | 3346 | +0.4% | 1.00x(?) |
ArrayValueProp4 | 5 | 5 | +0.0% | 1.00x |
ArrayValueProp2 | 5 | 5 | +0.0% | 1.00x |
ArrayValueProp3 | 5 | 5 | +0.0% | 1.00x |
Histogram | 657 | 662 | +0.8% | 0.99x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectForced | 4670 | 4703 | +0.7% | 0.99x(?) |
Prims | 749 | 754 | +0.7% | 0.99x(?) |
SuperChars | 361509 | 366503 | +1.4% | 0.99x(?) |
StrComplexWalk | 3122 | 3138 | +0.5% | 0.99x(?) |
ObjectiveCBridgeToNSSet | 16672 | 16867 | +1.2% | 0.99x(?) |
CaptureProp | 4158 | 4197 | +0.9% | 0.99x(?) |
UTF8Decode | 312 | 314 | +0.6% | 0.99x |
NopDeinit | 35409 | 35848 | +1.2% | 0.99x(?) |
SetIntersect | 1147 | 1154 | +0.6% | 0.99x(?) |
SetExclusiveOr | 3762 | 3786 | +0.6% | 0.99x(?) |
MonteCarloE | 10056 | 10182 | +1.2% | 0.99x(?) |
LinkedList | 6808 | 6843 | +0.5% | 0.99x(?) |
DeadArray | 180 | 182 | +1.1% | 0.99x(?) |
SevenBoom | 1312 | 1321 | +0.7% | 0.99x(?) |
DictionarySwap | 756 | 768 | +1.6% | 0.98x(?) |
ObjectiveCBridgeStubFromNSString | 592 | 607 | +2.5% | 0.98x(?) |
DictionaryOfObjects | 2194 | 2230 | +1.6% | 0.98x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced | 141657 | 144369 | +1.9% | 0.98x(?) |
Dictionary | 743 | 760 | +2.3% | 0.98x |
ObjectiveCBridgeFromNSString | 1590 | 1628 | +2.4% | 0.98x(?) |
Array2D | 2061 | 2132 | +3.4% | 0.97x(?) |
120 | 3195831 | 3289748 | +2.9% | 0.97x |
SortLettersInPlace | 965 | 991 | +2.7% | 0.97x(?) |
MapReduce | 367 | 378 | +3.0% | 0.97x(?) |
SortStringsUnicode | 9020 | 9257 | +2.6% | 0.97x(?) |
NSDictionaryCastToSwift | 13939 | 14358 | +3.0% | 0.97x |
NSStringConversion | 592 | 608 | +2.7% | 0.97x |
ObjectiveCBridgeFromNSDictionaryAnyObjectToString | 206801 | 215446 | +4.2% | 0.96x(?) |
DictionaryBridge | 3860 | 4013 | +4.0% | 0.96x(?) |
StringEqualPointerComparison | 7118 | 7508 | +5.5% | 0.95x(?) |
Regression (1)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
TypeFlood | 142 | 159 | +12.0% | 0.89x |
Improvement (9)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
PopFrontUnsafePointer | 251290 | 235546 | -6.3% | 1.07x |
PolymorphicCalls | 1273 | 1187 | -6.8% | 1.07x |
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced | 188157 | 174713 | -7.2% | 1.08x(?) |
ObjectiveCBridgeStubFromNSStringRef | 181 | 165 | -8.8% | 1.10x(?) |
ProtocolDispatch | 5895 | 5355 | -9.2% | 1.10x(?) |
BitCount | 100 | 91 | -9.0% | 1.10x(?) |
ObjectiveCBridgeFromNSArrayAnyObjectToString | 186252 | 167578 | -10.0% | 1.11x |
ObjectiveCBridgeStubFromArrayOfNSString | 135490 | 118017 | -12.9% | 1.15x |
ObjectiveCBridgeFromNSString | 5605 | 4842 | -13.6% | 1.16x |
No Changes (111)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
ObjectiveCBridgeFromNSDictionaryAnyObject | 264898 | 254875 | -3.8% | 1.04x |
Calculator | 977 | 942 | -3.6% | 1.04x |
StrToInt | 6840 | 6574 | -3.9% | 1.04x |
NopDeinit | 59360 | 57590 | -3.0% | 1.03x(?) |
NSDictionaryCastToSwift | 15892 | 15384 | -3.2% | 1.03x |
ObjectiveCBridgeFromNSSetAnyObjectForced | 7758 | 7563 | -2.5% | 1.03x(?) |
Histogram | 14451 | 14149 | -2.1% | 1.02x(?) |
DictionarySwapOfObjects | 26039 | 25649 | -1.5% | 1.02x(?) |
RGBHistogram | 53706 | 52512 | -2.2% | 1.02x(?) |
ArrayOfPOD | 2356 | 2304 | -2.2% | 1.02x(?) |
Chars | 5436 | 5339 | -1.8% | 1.02x(?) |
ClassArrayGetter | 1197 | 1190 | -0.6% | 1.01x(?) |
OpenClose | 497 | 491 | -1.2% | 1.01x(?) |
Dictionary3OfObjects | 2705 | 2681 | -0.9% | 1.01x(?) |
RangeAssignment | 24302 | 23964 | -1.4% | 1.01x |
StringHasSuffixUnicode | 64724 | 64387 | -0.5% | 1.01x(?) |
ArrayOfRef | 9092 | 8980 | -1.2% | 1.01x(?) |
DictionaryOfObjects | 5679 | 5610 | -1.2% | 1.01x(?) |
ArrayOfGenericRef | 9724 | 9662 | -0.6% | 1.01x(?) |
RC4 | 8609 | 8549 | -0.7% | 1.01x(?) |
ObjectiveCBridgeFromNSSetAnyObjectToStringForced | 130441 | 129415 | -0.8% | 1.01x(?) |
RGBHistogramOfObjects | 101447 | 100306 | -1.1% | 1.01x(?) |
StringWalk | 50933 | 50346 | -1.1% | 1.01x(?) |
120 | 6193563 | 6124600 | -1.1% | 1.01x |
Memset | 19815 | 19690 | -0.6% | 1.01x(?) |
ArraySubscript | 5346 | 5342 | -0.1% | 1.00x(?) |
MonteCarloPi | 50933 | 50960 | +0.1% | 1.00x(?) |
RecursiveOwnedParameter | 7638 | 7637 | -0.0% | 1.00x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectToString | 223950 | 224030 | +0.0% | 1.00x(?) |
Array2D | 769979 | 767359 | -0.3% | 1.00x(?) |
SortStrings | 2592 | 2580 | -0.5% | 1.00x(?) |
StringWithCString | 729723 | 729902 | +0.0% | 1.00x(?) |
Prims | 14183 | 14168 | -0.1% | 1.00x(?) |
ByteSwap | 10 | 10 | +0.0% | 1.00x |
SuperChars | 534854 | 533946 | -0.2% | 1.00x(?) |
StringInterpolation | 16027 | 15952 | -0.5% | 1.00x(?) |
ArrayLiteral | 1080 | 1076 | -0.4% | 1.00x(?) |
Dictionary3 | 2046 | 2052 | +0.3% | 1.00x(?) |
SetIntersect_OfObjects | 19458 | 19402 | -0.3% | 1.00x(?) |
Join | 1439 | 1442 | +0.2% | 1.00x(?) |
MapReduce | 43160 | 42975 | -0.4% | 1.00x(?) |
DictionaryLiteral | 24673 | 24703 | +0.1% | 1.00x(?) |
ArrayOfGenericPOD | 3390 | 3406 | +0.5% | 1.00x(?) |
DictionaryRemoveOfObjects | 62293 | 62394 | +0.2% | 1.00x(?) |
UTF8Decode | 41707 | 41829 | +0.3% | 1.00x(?) |
SetIsSubsetOf | 3034 | 3049 | +0.5% | 1.00x(?) |
Dictionary | 2800 | 2810 | +0.4% | 1.00x(?) |
SetIntersect | 19503 | 19520 | +0.1% | 1.00x(?) |
StringBuilder | 2880 | 2878 | -0.1% | 1.00x(?) |
ArrayInClass | 3656 | 3672 | +0.4% | 1.00x(?) |
Sim2DArray | 14058 | 14064 | +0.0% | 1.00x(?) |
MonteCarloE | 103786 | 104016 | +0.2% | 1.00x(?) |
SetUnion_OfObjects | 49313 | 49495 | +0.4% | 1.00x(?) |
SetIsSubsetOf_OfObjects | 2864 | 2878 | +0.5% | 1.00x(?) |
LinkedList | 26293 | 26324 | +0.1% | 1.00x |
DeadArray | 131756 | 131938 | +0.1% | 1.00x(?) |
AngryPhonebook | 3615 | 3618 | +0.1% | 1.00x(?) |
SevenBoom | 1474 | 1479 | +0.3% | 1.00x(?) |
GlobalClass | 0 | 0 | +0.0% | 1.00x |
Dictionary2OfObjects | 6966 | 6967 | +0.0% | 1.00x(?) |
ObjectiveCBridgeToNSString | 1087 | 1098 | +1.0% | 0.99x(?) |
StackPromo | 133191 | 134183 | +0.7% | 0.99x(?) |
ObjectiveCBridgeStubToNSString | 1313 | 1326 | +1.0% | 0.99x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectForced | 7386 | 7438 | +0.7% | 0.99x(?) |
ObjectiveCBridgeFromNSStringForced | 2630 | 2661 | +1.2% | 0.99x(?) |
DictionarySwap | 11120 | 11181 | +0.6% | 0.99x(?) |
XorLoop | 18579 | 18713 | +0.7% | 0.99x |
ObjectAllocation | 540 | 547 | +1.3% | 0.99x(?) |
HashTest | 5401 | 5456 | +1.0% | 0.99x(?) |
PopFrontArrayGeneric | 11009 | 11065 | +0.5% | 0.99x(?) |
SetExclusiveOr | 46008 | 46447 | +0.9% | 0.99x(?) |
SetExclusiveOr_OfObjects | 65181 | 65861 | +1.0% | 0.99x |
ObjectiveCBridgeToNSDictionary | 17047 | 17164 | +0.7% | 0.99x(?) |
Walsh | 12228 | 12391 | +1.3% | 0.99x |
ObjectiveCBridgeToNSSet | 16779 | 16884 | +0.6% | 0.99x(?) |
DictionaryRemove | 31045 | 31379 | +1.1% | 0.99x |
NSStringConversion | 2709 | 2742 | +1.2% | 0.99x(?) |
ArrayAppendReserved | 3098 | 3118 | +0.7% | 0.99x(?) |
SetUnion | 31704 | 31892 | +0.6% | 0.99x |
ArrayValueProp4 | 2673 | 2696 | +0.9% | 0.99x(?) |
TwoSum | 9584 | 9639 | +0.6% | 0.99x(?) |
ArrayValueProp2 | 2795 | 2835 | +1.4% | 0.99x |
ArrayValueProp3 | 2711 | 2732 | +0.8% | 0.99x(?) |
DictionaryBridge | 4011 | 4086 | +1.9% | 0.98x(?) |
ObjectiveCBridgeFromNSArrayAnyObjectForced | 7201 | 7311 | +1.5% | 0.98x(?) |
SortLettersInPlace | 2516 | 2560 | +1.8% | 0.98x(?) |
StrComplexWalk | 8227 | 8373 | +1.8% | 0.98x(?) |
Integrate | 358 | 364 | +1.7% | 0.98x(?) |
StaticArray | 26590 | 27224 | +2.4% | 0.98x(?) |
ProtocolDispatch2 | 430 | 440 | +2.3% | 0.98x(?) |
Dictionary2 | 5114 | 5202 | +1.7% | 0.98x(?) |
StringHasPrefix | 1552 | 1583 | +2.0% | 0.98x(?) |
ArrayAppend | 3374 | 3439 | +1.9% | 0.98x(?) |
ObjectiveCBridgeToNSArray | 31316 | 31852 | +1.7% | 0.98x(?) |
NSError | 667 | 679 | +1.8% | 0.98x(?) |
CaptureProp | 115068 | 117652 | +2.2% | 0.98x |
Hanoi | 19329 | 19676 | +1.8% | 0.98x(?) |
ObjectiveCBridgeFromNSArrayAnyObject | 69289 | 70426 | +1.6% | 0.98x(?) |
Phonebook | 61979 | 63017 | +1.7% | 0.98x(?) |
PopFrontArray | 23748 | 24371 | +2.6% | 0.97x |
ErrorHandling | 3755 | 3857 | +2.7% | 0.97x(?) |
ObjectiveCBridgeFromNSSetAnyObject | 115522 | 118985 | +3.0% | 0.97x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced | 142584 | 147458 | +3.4% | 0.97x(?) |
ObjectiveCBridgeStubToArrayOfNSString | 31143 | 31961 | +2.6% | 0.97x |
ObjectiveCBridgeFromNSSetAnyObjectToString | 170468 | 176616 | +3.6% | 0.97x(?) |
StringHasPrefixUnicode | 17031 | 17575 | +3.2% | 0.97x |
ArrayValueProp | 2237 | 2302 | +2.9% | 0.97x |
ObjectiveCBridgeStubFromNSString | 618 | 646 | +4.5% | 0.96x |
StringEqualPointerComparison | 9441 | 9829 | +4.1% | 0.96x(?) |
SortStringsUnicode | 9985 | 10354 | +3.7% | 0.96x |
StringHasSuffix | 1542 | 1603 | +4.0% | 0.96x(?) |
@gottesmm Are the perf regressions on |
@swift-ci Please benchmark |
Spoke with @gottesmm offline, these benchmark results look within expected variance. Starting a second run just to check though. |
Build comment file:Optimized (O)
|
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
ArrayInClass | 85 | 91 | +7.1% | 0.93x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectToString | 205321 | 217641 | +6.0% | 0.94x(?) |
Improvement (3)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced | 187555 | 176558 | -5.9% | 1.06x |
ObjectiveCBridgeFromNSSetAnyObjectToStringForced | 126736 | 118775 | -6.3% | 1.07x(?) |
ObjectiveCBridgeStubFromArrayOfNSString | 128068 | 115345 | -9.9% | 1.11x |
No Changes (116)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
ObjectiveCBridgeToNSSet | 16818 | 15946 | -5.2% | 1.05x(?) |
NSDictionaryCastToSwift | 14408 | 13812 | -4.1% | 1.04x |
DictionaryBridge | 3950 | 3836 | -2.9% | 1.03x(?) |
DictionarySwap | 774 | 755 | -2.5% | 1.03x |
RangeAssignment | 329 | 319 | -3.0% | 1.03x(?) |
AngryPhonebook | 2873 | 2801 | -2.5% | 1.03x(?) |
120 | 3211931 | 3127444 | -2.6% | 1.03x |
TwoSum | 1930 | 1881 | -2.5% | 1.03x |
ObjectiveCBridgeFromNSArrayAnyObjectToString | 182348 | 178676 | -2.0% | 1.02x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObject | 250561 | 245684 | -1.9% | 1.02x(?) |
StaticArray | 2826 | 2770 | -2.0% | 1.02x(?) |
OpenClose | 51 | 50 | -2.0% | 1.02x |
CaptureProp | 4222 | 4150 | -1.7% | 1.02x(?) |
Hanoi | 3363 | 3312 | -1.5% | 1.02x(?) |
ObjectiveCBridgeFromNSSetAnyObjectToString | 163587 | 159897 | -2.3% | 1.02x(?) |
ArrayAppendReserved | 523 | 514 | -1.7% | 1.02x(?) |
SortStrings | 1813 | 1790 | -1.3% | 1.01x(?) |
Integrate | 242 | 240 | -0.8% | 1.01x |
StringHasSuffixUnicode | 64767 | 63880 | -1.4% | 1.01x(?) |
ProtocolDispatch2 | 156 | 155 | -0.6% | 1.01x |
Walsh | 342 | 337 | -1.5% | 1.01x(?) |
MapReduce | 377 | 373 | -1.1% | 1.01x(?) |
UTF8Decode | 315 | 312 | -0.9% | 1.01x |
ObjectiveCBridgeFromNSArrayAnyObject | 67161 | 66380 | -1.2% | 1.01x(?) |
SetExclusiveOr | 3772 | 3730 | -1.1% | 1.01x(?) |
DictionaryRemove | 5111 | 5046 | -1.3% | 1.01x(?) |
StringHasPrefixUnicode | 15618 | 15458 | -1.0% | 1.01x(?) |
Chars | 654 | 648 | -0.9% | 1.01x(?) |
StrToInt | 5804 | 5724 | -1.4% | 1.01x |
ArraySubscript | 1351 | 1353 | +0.1% | 1.00x(?) |
ObjectiveCBridgeToNSString | 1071 | 1072 | +0.1% | 1.00x(?) |
StackPromo | 18940 | 18936 | -0.0% | 1.00x(?) |
RecursiveOwnedParameter | 1829 | 1829 | +0.0% | 1.00x |
ObjectiveCBridgeStubToNSString | 1271 | 1275 | +0.3% | 1.00x(?) |
ClassArrayGetter | 12 | 12 | +0.0% | 1.00x |
Histogram | 656 | 659 | +0.5% | 1.00x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectForced | 4679 | 4683 | +0.1% | 1.00x(?) |
MonteCarloPi | 42742 | 42763 | +0.1% | 1.00x(?) |
StringWithCString | 587382 | 587771 | +0.1% | 1.00x(?) |
Dictionary3OfObjects | 883 | 882 | -0.1% | 1.00x(?) |
StringHasPrefix | 654 | 651 | -0.5% | 1.00x(?) |
ByteSwap | 1 | 1 | +0.0% | 1.00x |
SuperChars | 362286 | 363051 | +0.2% | 1.00x(?) |
XorLoop | 360 | 360 | +0.0% | 1.00x |
ErrorHandling | 3004 | 2997 | -0.2% | 1.00x(?) |
ProtocolDispatch | 2975 | 2983 | +0.3% | 1.00x(?) |
TypeFlood | 0 | 0 | +0.0% | 1.00x |
Dictionary3 | 534 | 533 | -0.2% | 1.00x(?) |
StrComplexWalk | 3165 | 3161 | -0.1% | 1.00x(?) |
SetIntersect_OfObjects | 2354 | 2348 | -0.2% | 1.00x(?) |
Join | 457 | 458 | +0.2% | 1.00x(?) |
NSError | 332 | 332 | +0.0% | 1.00x |
PopFrontUnsafePointer | 9274 | 9315 | +0.4% | 1.00x(?) |
StringEqualPointerComparison | 7293 | 7293 | +0.0% | 1.00x |
PolymorphicCalls | 61 | 61 | +0.0% | 1.00x |
Calculator | 33 | 33 | +0.0% | 1.00x |
ArrayOfGenericPOD | 207 | 207 | +0.0% | 1.00x |
DictionaryRemoveOfObjects | 20036 | 20057 | +0.1% | 1.00x(?) |
SortStringsUnicode | 9221 | 9199 | -0.2% | 1.00x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced | 142153 | 142807 | +0.5% | 1.00x(?) |
SetIsSubsetOf | 487 | 487 | +0.0% | 1.00x |
Dictionary | 755 | 755 | +0.0% | 1.00x |
NopDeinit | 35642 | 35742 | +0.3% | 1.00x(?) |
SetIntersect | 1156 | 1157 | +0.1% | 1.00x(?) |
RGBHistogramOfObjects | 21904 | 21987 | +0.4% | 1.00x(?) |
SetExclusiveOr_OfObjects | 8463 | 8439 | -0.3% | 1.00x(?) |
MonteCarloE | 11577 | 11588 | +0.1% | 1.00x(?) |
SetUnion_OfObjects | 7143 | 7115 | -0.4% | 1.00x(?) |
RC4 | 254 | 253 | -0.4% | 1.00x(?) |
SetIsSubsetOf_OfObjects | 611 | 611 | +0.0% | 1.00x |
LinkedList | 6833 | 6841 | +0.1% | 1.00x(?) |
RGBHistogram | 3117 | 3103 | -0.5% | 1.00x |
ObjectiveCBridgeFromNSSetAnyObjectForced | 4133 | 4116 | -0.4% | 1.00x(?) |
ArrayOfPOD | 172 | 172 | +0.0% | 1.00x |
SetUnion | 3316 | 3309 | -0.2% | 1.00x(?) |
DeadArray | 182 | 182 | +0.0% | 1.00x |
BitCount | 1 | 1 | +0.0% | 1.00x |
ArrayLiteral | 1009 | 1012 | +0.3% | 1.00x(?) |
SevenBoom | 1327 | 1328 | +0.1% | 1.00x(?) |
StringWalk | 6179 | 6209 | +0.5% | 1.00x(?) |
ArrayValueProp | 5 | 5 | +0.0% | 1.00x |
GlobalClass | 0 | 0 | +0.0% | 1.00x |
Memset | 222 | 222 | +0.0% | 1.00x |
Dictionary2OfObjects | 3364 | 3366 | +0.1% | 1.00x(?) |
ArrayValueProp4 | 5 | 5 | +0.0% | 1.00x |
ArrayValueProp2 | 5 | 5 | +0.0% | 1.00x |
ArrayValueProp3 | 5 | 5 | +0.0% | 1.00x |
DictionarySwapOfObjects | 6644 | 6720 | +1.1% | 0.99x(?) |
PopFrontArray | 1177 | 1187 | +0.8% | 0.99x(?) |
ObjectiveCBridgeFromNSStringForced | 2239 | 2264 | +1.1% | 0.99x(?) |
Prims | 755 | 760 | +0.7% | 0.99x(?) |
SortLettersInPlace | 973 | 981 | +0.8% | 0.99x(?) |
ObjectiveCBridgeFromNSSetAnyObject | 110766 | 112280 | +1.4% | 0.99x(?) |
ObjectiveCBridgeToNSArray | 31681 | 31942 | +0.8% | 0.99x(?) |
PopFrontArrayGeneric | 1177 | 1190 | +1.1% | 0.99x(?) |
DictionaryLiteral | 4369 | 4397 | +0.6% | 0.99x(?) |
ObjectiveCBridgeStubToArrayOfNSString | 31673 | 31890 | +0.7% | 0.99x(?) |
StringBuilder | 1513 | 1524 | +0.7% | 0.99x(?) |
StringHasSuffix | 666 | 671 | +0.8% | 0.99x(?) |
Phonebook | 7189 | 7246 | +0.8% | 0.99x(?) |
ObjectiveCBridgeToNSDictionary | 17167 | 17309 | +0.8% | 0.99x(?) |
HashTest | 1979 | 1989 | +0.5% | 0.99x(?) |
ArrayAppend | 733 | 738 | +0.7% | 0.99x(?) |
ObjectiveCBridgeFromNSString | 1614 | 1626 | +0.7% | 0.99x(?) |
Array2D | 2029 | 2069 | +2.0% | 0.98x(?) |
ObjectiveCBridgeFromNSArrayAnyObjectForced | 3744 | 3815 | +1.9% | 0.98x(?) |
StringInterpolation | 11331 | 11523 | +1.7% | 0.98x(?) |
ObjectiveCBridgeStubFromNSStringRef | 129 | 131 | +1.6% | 0.98x(?) |
ObjectiveCBridgeStubFromNSString | 594 | 604 | +1.7% | 0.98x |
Dictionary2 | 1899 | 1938 | +2.0% | 0.98x |
ArrayOfRef | 3467 | 3533 | +1.9% | 0.98x(?) |
DictionaryOfObjects | 2242 | 2283 | +1.8% | 0.98x(?) |
ArrayOfGenericRef | 3574 | 3642 | +1.9% | 0.98x(?) |
NSStringConversion | 597 | 609 | +2.0% | 0.98x |
ObjectAllocation | 146 | 151 | +3.4% | 0.97x(?) |
Sim2DArray | 430 | 442 | +2.8% | 0.97x |
Regression (3)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced | 144846 | 160012 | +10.5% | 0.91x |
BitCount | 93 | 102 | +9.7% | 0.91x |
StringHasSuffix | 1489 | 1581 | +6.2% | 0.94x(?) |
Improvement (11)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
StrToInt | 6938 | 6551 | -5.6% | 1.06x |
TwoSum | 10062 | 9506 | -5.5% | 1.06x |
Integrate | 384 | 360 | -6.2% | 1.07x(?) |
OpenClose | 520 | 488 | -6.2% | 1.07x |
ObjectiveCBridgeFromNSString | 5183 | 4861 | -6.2% | 1.07x |
ArrayAppendReserved | 3476 | 3258 | -6.3% | 1.07x(?) |
NopDeinit | 60534 | 55549 | -8.2% | 1.09x(?) |
ObjectiveCBridgeStubFromArrayOfNSString | 126763 | 115829 | -8.6% | 1.09x |
ObjectiveCBridgeFromNSArrayAnyObjectToString | 191387 | 172700 | -9.8% | 1.11x |
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced | 183443 | 165508 | -9.8% | 1.11x(?) |
ProtocolDispatch | 5912 | 5191 | -12.2% | 1.14x(?) |
No Changes (107)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
Histogram | 14574 | 13851 | -5.0% | 1.05x |
PopFrontUnsafePointer | 256917 | 244546 | -4.8% | 1.05x(?) |
ObjectiveCBridgeToNSDictionary | 17048 | 16265 | -4.6% | 1.05x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectToString | 228257 | 220114 | -3.6% | 1.04x |
Calculator | 970 | 936 | -3.5% | 1.04x |
SetIsSubsetOf | 3111 | 2990 | -3.9% | 1.04x |
ObjectiveCBridgeFromNSSetAnyObjectToStringForced | 133071 | 128347 | -3.5% | 1.04x(?) |
Dictionary3OfObjects | 2745 | 2673 | -2.6% | 1.03x |
ObjectiveCBridgeStubFromNSStringRef | 161 | 157 | -2.5% | 1.03x(?) |
DictionaryLiteral | 25090 | 24431 | -2.6% | 1.03x(?) |
RGBHistogram | 53379 | 51707 | -3.1% | 1.03x(?) |
StringWalk | 50956 | 49432 | -3.0% | 1.03x |
ObjectiveCBridgeToNSString | 1115 | 1094 | -1.9% | 1.02x(?) |
PopFrontArray | 24110 | 23746 | -1.5% | 1.02x(?) |
StringHasPrefix | 1558 | 1533 | -1.6% | 1.02x(?) |
ErrorHandling | 3834 | 3761 | -1.9% | 1.02x(?) |
TypeFlood | 153 | 150 | -2.0% | 1.02x(?) |
ObjectiveCBridgeFromNSSetAnyObject | 119586 | 117724 | -1.6% | 1.02x(?) |
ArrayLiteral | 1091 | 1074 | -1.6% | 1.02x(?) |
ObjectiveCBridgeToNSSet | 16875 | 16579 | -1.8% | 1.02x(?) |
NSError | 682 | 667 | -2.2% | 1.02x |
RGBHistogramOfObjects | 102212 | 100280 | -1.9% | 1.02x |
ArrayOfPOD | 2323 | 2282 | -1.8% | 1.02x(?) |
ArraySubscript | 5371 | 5338 | -0.6% | 1.01x(?) |
RecursiveOwnedParameter | 7710 | 7647 | -0.8% | 1.01x(?) |
SortStrings | 2608 | 2588 | -0.8% | 1.01x(?) |
120 | 6120914 | 6078221 | -0.7% | 1.01x |
ObjectiveCBridgeFromNSStringForced | 2737 | 2700 | -1.4% | 1.01x(?) |
SortLettersInPlace | 2551 | 2526 | -1.0% | 1.01x |
ObjectAllocation | 541 | 535 | -1.1% | 1.01x(?) |
Dictionary2 | 5248 | 5201 | -0.9% | 1.01x(?) |
DictionaryOfObjects | 5627 | 5592 | -0.6% | 1.01x(?) |
PopFrontArrayGeneric | 11117 | 11020 | -0.9% | 1.01x(?) |
PolymorphicCalls | 1202 | 1188 | -1.2% | 1.01x(?) |
Hanoi | 19711 | 19433 | -1.4% | 1.01x |
UTF8Decode | 41834 | 41349 | -1.2% | 1.01x |
Dictionary | 2820 | 2798 | -0.8% | 1.01x(?) |
SetIntersect | 19540 | 19426 | -0.6% | 1.01x(?) |
ObjectiveCBridgeFromNSSetAnyObjectToString | 176226 | 174384 | -1.1% | 1.01x(?) |
StringHasSuffixUnicode | 65037 | 64169 | -1.3% | 1.01x(?) |
SetUnion | 31887 | 31690 | -0.6% | 1.01x |
DeadArray | 131067 | 129438 | -1.2% | 1.01x(?) |
AngryPhonebook | 3649 | 3630 | -0.5% | 1.01x |
SevenBoom | 1488 | 1471 | -1.1% | 1.01x(?) |
ArrayValueProp | 2253 | 2228 | -1.1% | 1.01x(?) |
RC4 | 8587 | 8544 | -0.5% | 1.01x |
StackPromo | 134841 | 134464 | -0.3% | 1.00x(?) |
ObjectiveCBridgeStubToNSString | 1323 | 1323 | +0.0% | 1.00x |
ClassArrayGetter | 1186 | 1185 | -0.1% | 1.00x(?) |
Array2D | 769650 | 768372 | -0.2% | 1.00x(?) |
DictionaryBridge | 3978 | 3997 | +0.5% | 1.00x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectForced | 7327 | 7319 | -0.1% | 1.00x(?) |
MonteCarloPi | 50892 | 50789 | -0.2% | 1.00x(?) |
ObjectiveCBridgeFromNSArrayAnyObjectForced | 7248 | 7231 | -0.2% | 1.00x(?) |
Prims | 14065 | 14105 | +0.3% | 1.00x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObject | 249781 | 249132 | -0.3% | 1.00x(?) |
RangeAssignment | 23680 | 23673 | -0.0% | 1.00x(?) |
ByteSwap | 10 | 10 | +0.0% | 1.00x |
SuperChars | 534676 | 536887 | +0.4% | 1.00x(?) |
XorLoop | 18644 | 18620 | -0.1% | 1.00x(?) |
StringInterpolation | 15827 | 15871 | +0.3% | 1.00x(?) |
StaticArray | 27108 | 27128 | +0.1% | 1.00x(?) |
ProtocolDispatch2 | 438 | 438 | +0.0% | 1.00x |
Dictionary3 | 2032 | 2042 | +0.5% | 1.00x(?) |
Join | 1446 | 1449 | +0.2% | 1.00x(?) |
StringEqualPointerComparison | 9602 | 9595 | -0.1% | 1.00x(?) |
MapReduce | 43118 | 42918 | -0.5% | 1.00x(?) |
DictionaryRemoveOfObjects | 61896 | 61766 | -0.2% | 1.00x(?) |
SortStringsUnicode | 10201 | 10212 | +0.1% | 1.00x(?) |
ObjectiveCBridgeStubToArrayOfNSString | 31688 | 31791 | +0.3% | 1.00x(?) |
SetExclusiveOr | 46671 | 46678 | +0.0% | 1.00x(?) |
NSDictionaryCastToSwift | 15599 | 15577 | -0.1% | 1.00x(?) |
GlobalClass | 0 | 0 | +0.0% | 1.00x |
StringBuilder | 2844 | 2845 | +0.0% | 1.00x(?) |
ArrayInClass | 3668 | 3664 | -0.1% | 1.00x(?) |
ArrayOfGenericRef | 9678 | 9644 | -0.3% | 1.00x(?) |
Sim2DArray | 14043 | 14054 | +0.1% | 1.00x(?) |
SetExclusiveOr_OfObjects | 65815 | 65519 | -0.5% | 1.00x |
MonteCarloE | 103712 | 104164 | +0.4% | 1.00x(?) |
SetUnion_OfObjects | 49350 | 49154 | -0.4% | 1.00x |
Walsh | 12155 | 12184 | +0.2% | 1.00x(?) |
DictionaryRemove | 30978 | 31123 | +0.5% | 1.00x(?) |
LinkedList | 26368 | 26397 | +0.1% | 1.00x |
StringWithCString | 729551 | 731286 | +0.2% | 1.00x(?) |
Memset | 19704 | 19680 | -0.1% | 1.00x(?) |
Dictionary2OfObjects | 7008 | 7021 | +0.2% | 1.00x(?) |
ArrayValueProp4 | 2681 | 2671 | -0.4% | 1.00x(?) |
ArrayValueProp2 | 2814 | 2803 | -0.4% | 1.00x(?) |
DictionarySwapOfObjects | 25464 | 25594 | +0.5% | 0.99x(?) |
DictionarySwap | 11051 | 11183 | +1.2% | 0.99x |
HashTest | 5434 | 5476 | +0.8% | 0.99x(?) |
StrComplexWalk | 8292 | 8413 | +1.5% | 0.99x |
SetIntersect_OfObjects | 19194 | 19291 | +0.5% | 0.99x(?) |
ArrayOfRef | 8895 | 9000 | +1.2% | 0.99x(?) |
ObjectiveCBridgeToNSArray | 31243 | 31482 | +0.8% | 0.99x(?) |
ArrayOfGenericPOD | 3362 | 3403 | +1.2% | 0.99x(?) |
SetIsSubsetOf_OfObjects | 2876 | 2893 | +0.6% | 0.99x(?) |
ArrayAppend | 3325 | 3373 | +1.4% | 0.99x(?) |
StringHasPrefixUnicode | 17005 | 17217 | +1.2% | 0.99x(?) |
ObjectiveCBridgeFromNSSetAnyObjectForced | 7650 | 7691 | +0.5% | 0.99x(?) |
ArrayValueProp3 | 2701 | 2715 | +0.5% | 0.99x(?) |
CaptureProp | 115967 | 117950 | +1.7% | 0.98x(?) |
NSStringConversion | 2687 | 2743 | +2.1% | 0.98x(?) |
Chars | 5141 | 5251 | +2.1% | 0.98x(?) |
ObjectiveCBridgeStubFromNSString | 624 | 643 | +3.0% | 0.97x |
ObjectiveCBridgeFromNSArrayAnyObject | 70071 | 71891 | +2.6% | 0.97x |
Phonebook | 62206 | 64060 | +3.0% | 0.97x |
Nice! |
Get rid of the transparent intrinsics in the stdlib for optional-to-bool conversion and force-unwrapping optionals so we can generate simpler, non-memory code for these common operations.