Skip to content

SILOptimizer: Replace [].append(contentsOf:) with [].append(element:) #6652

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

Closed
wants to merge 2 commits into from

Conversation

ben-ng
Copy link

@ben-ng ben-ng commented Jan 8, 2017

This makes myArray += [42] equivalent to myArray.append(42), which results in a 6x speedup. It does this by modifying the ArrayElementValuePropagation pass, replacing calls to Array.append(contentsOf: with calls to Array.append(element:.

Re-submission of #5978, which was reverted in #6103 because it caused a memory leak in the stdlib/Dictionary.swift and stdlib/Set.swift tests. The problem was that I never destroyed the copy of the value. That has been fixed.

@gottesmm mentioned that there was also a benchmarking regression in ArrayAppend. Is it because I added a new benchmark in this pull request, and the driver only reports the aggregate time for the entire file? I don't see how this optimization could affect the results of the existing tests.

@airspeedswift
Copy link
Member

If you pull the benchmark you've added out into a separate PR and merge that first, you'll be able to see the impact via asking at-swift-ci please benchmark in this PR.

Note, this PR landed recently and touches Array.append and +=. Not sure if that has any impact but you may want to rebase.

@ben-ng
Copy link
Author

ben-ng commented Jan 8, 2017

@airspeedswift thanks for the tip. This was already rebased on top of your PR, and tests were fine. I'll pull the benchmark out to a separate PR now.

@ben-ng ben-ng force-pushed the bng-siloptimizer-array-append branch from 1b59b2f to 02ce5ac Compare January 8, 2017 05:06
@ben-ng
Copy link
Author

ben-ng commented Jan 8, 2017

I realized in #6653 that I've been holding the benchmark driver wrong. It looks like this pull request does cause a regression in ArrayAppend.

  # TEST                               SAMPLES MIN(μs) MAX(μs) MEAN(μs) SD(μs) MEDIAN(μs) MAX_RSS(B)
  // Prior to this pull request
  4 ArrayAppend                              3     737     754      747      0        747    5072213
  6 ArrayAppendCollectionUsingOperator       3   53518   54535    54013      0      54013    5211477

  // After this pull request
  4 ArrayAppend                              3    1038    1078     1056      0       1056    4879701
  6 ArrayAppendCollectionUsingOperator       3    1844    1996     1943      0       1943    5199189

@ben-ng
Copy link
Author

ben-ng commented Jan 8, 2017

On second thought, that benchmark run appears to be running without optimizations, so the results are expected.

The regression in ArrayAppend is expected, because my semantics tag is stopping a method from being inlined.

The performance improvement in the my new test (26x) is also much more significant than it was in my earlier testing (~6x), because I was testing with optimizations enabled.

I'm not sure how to run the benchmarks with optimizations locally. The build script flags for setting iteration counts don't seem to be working.

@airspeedswift
Copy link
Member

It occurs to me that maybe, when we detect this, we should be issuing a compiler warning that lets the user know there's a more appropriate way to do this, rather than optimizing away the problems from the incorrect usage. Or maybe both, but that's probably pointless.

@mattrajca
Copy link
Contributor

mattrajca commented Jan 8, 2017

There is nothing wrong with writing array += [item] instead of array.append(item). It's a matter of style and personal preference, but regardless of which style the user prefers, one should not be 20x slower than the other. The user should not have to micro-optimize this. That should be done by the compiler and not by presenting a warning to users that gives them more work to do.

@airspeedswift
Copy link
Member

"There is nothing wrong with writing array += [item] instead of array.append(item)." Creating a whole new collection purely to be able to use an operator intended for appending a collection instead of the appropriate provided method to append a single element is incorrect usage not a style preference. I'm skeptical of hiding it with optimizer magic.

@airspeedswift
Copy link
Member

Then again, I think the reason why we don't have overloads to do myArray += newElement is because myArrayOfAny += [1,2,3] would be ambiguous, so maybe I'm wrong.

@ben-ng
Copy link
Author

ben-ng commented Jan 8, 2017

This optimization doesn't only target single element appends. It also unrolls array += [a, b, c] into a series of array.append(foo) if the collection is small enough that this optimization makes sense. In my testing, that magic number is six. Users of Swift shouldn't have to figure out this magic number themselves, and a series of appends is also less readable than the += version.

If I recall, myArray += newElement used to be a thing, but it was removed for that very reason.

@airspeedswift
Copy link
Member

airspeedswift commented Jan 8, 2017

Ah OK I see, the 2+ case is fair game. Then again, by unrolling the [a, b, c] case into calling append, the receiving collection is missing out on information about how many items are going to be appended. Suppose appending five more elements doesn't require a reallocation of the buffer, but appending six does, then the array would need to write 5 elements, then scrap that and realloc the buffer to write the 6th. Whereas append(contentsOf:) has a chance to reallocate before writing anything.

Sorry for the rehash if you've already accounted for this...

@ben-ng
Copy link
Author

ben-ng commented Jan 8, 2017

I did not account for that scenario. I haven't looked at Array's implementation, but if it doubles the size of its buffer each time, then that scenario gets exceedingly rare quite quickly. The wasted time should be dwarfed by the performance gains. A benchmark for this also wouldn't reflect real-world use of Array.append because we'd have to assume so much about Array's internals.

@airspeedswift
Copy link
Member

Yup it doubles each time. It would be rare for large arrays, but could easily happen for small ones. You're right, it may not be very material though.

@slavapestov
Copy link
Contributor

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 1b59b2fe2ae003c4f5437980aacd575328cecabd
Test requested by - @slavapestov

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 1b59b2fe2ae003c4f5437980aacd575328cecabd
Test requested by - @slavapestov

@ben-ng
Copy link
Author

ben-ng commented Jan 10, 2017

@slavapestov we should also test with preset=buildbot,tools=RA,stdlib=RD. The previous failure only happened when the stdlib tests were optimized.

@slavapestov slavapestov self-assigned this Jan 11, 2017
@slavapestov
Copy link
Contributor

preset=buildbot,tools=RA,stdlib=RD
@swift-ci Please test with preset macOS

@slavapestov
Copy link
Contributor

preset=buildbot,tools=RA,stdlib=RD
@swift-ci Please test macOS with preset

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test macOS with preset
Git Commit - 1b59b2fe2ae003c4f5437980aacd575328cecabd
Test requested by - @slavapestov

@slavapestov
Copy link
Contributor

@ben-ng I think I kicked it off correctly. This one takes several hours, so I'll merge this patch tonight if it succeeds. Thank you for your contribution!

@airspeedswift
Copy link
Member

@slavapestov I'd still ideally like to see the benchmarks run from the PR before merging, but that's dependent on #6653 getting merged.

@ben-ng
Copy link
Author

ben-ng commented Jan 12, 2017

@airspeedswift I agree, I'll make the changes to the benchmark PR now so that it can be run & merged.

@airspeedswift
Copy link
Member

airspeedswift commented Jan 12, 2017 via email

@ben-ng
Copy link
Author

ben-ng commented Jan 12, 2017

Can I get a @swift-ci please benchmark on this now that the benchmarks are merged?

@airspeedswift
Copy link
Member

Does this have the added 2nd benchmark? That might be the conflict the merge button is flagging... can you rebase that in?

@ben-ng ben-ng force-pushed the bng-siloptimizer-array-append branch from 02ce5ac to 75b6dba Compare January 12, 2017 04:18
@ben-ng
Copy link
Author

ben-ng commented Jan 12, 2017

Oh right, I forgot to rebase. Done.

@airspeedswift
Copy link
Member

@swift-ci please benchmark

@airspeedswift
Copy link
Member

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 02ce5ac4ff3fdf2b0d374f1b114def7df53f6ae3
Test requested by - @airspeedswift

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 02ce5ac4ff3fdf2b0d374f1b114def7df53f6ae3
Test requested by - @airspeedswift

@slavapestov
Copy link
Contributor

@swift-ci Please benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (7)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ArrayAppendLazyMap 916 5221 +470.0% 0.18x
ArrayAppendReserved 535 863 +61.3% 0.62x
ArrayAppend 775 1228 +58.5% 0.63x
ArrayAppendRepeatCol 759 921 +21.3% 0.82x
ObjectiveCBridgeStubDateAccess 182 212 +16.5% 0.86x
PopFrontArrayGeneric 1146 1305 +13.9% 0.88x(?)
ArrayAppendSequence 1392 1507 +8.3% 0.92x
Improvement (4)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ObjectiveCBridgeStubNSDateRefAccess 338 308 -8.9% 1.10x
OpenClose 54 48 -11.1% 1.12x
ArrayPlusEqualFiveElementCollection 52079 7941 -84.8% 6.56x
ArrayPlusEqualSingleElementCollection 48387 2078 -95.7% 23.29x
No Changes (146)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
PolymorphicCalls 22 21 -4.5% 1.05x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 176943 170804 -3.5% 1.04x(?)
ObserverClosure 1969 1892 -3.9% 1.04x(?)
ObserverPartiallyAppliedMethod 3381 3262 -3.5% 1.04x(?)
SortSortedStrings 832 811 -2.5% 1.03x
Phonebook 7425 7180 -3.3% 1.03x
StrToInt 5084 4914 -3.3% 1.03x
ObjectiveCBridgeStubURLAppendPath 236990 231990 -2.1% 1.02x(?)
SetIntersect 361 355 -1.7% 1.02x(?)
ObjectiveCBridgeToNSDictionary 62081 60772 -2.1% 1.02x(?)
156 2964048 2907797 -1.9% 1.02x
ObjectiveCBridgeStubFromArrayOfNSString 58591 57257 -2.3% 1.02x(?)
ObjectiveCBridgeToNSString 1073 1067 -0.6% 1.01x
ObjectiveCBridgeFromNSArrayAnyObjectToString 97895 96523 -1.4% 1.01x(?)
SortStrings 1646 1632 -0.8% 1.01x(?)
DictionarySwapOfObjects 6238 6203 -0.6% 1.01x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 165955 164015 -1.2% 1.01x(?)
AnyHashableWithAClass 65501 64992 -0.8% 1.01x(?)
ErrorHandling 2925 2906 -0.7% 1.01x(?)
ObjectAllocation 154 153 -0.7% 1.01x(?)
Dictionary2 2039 2026 -0.6% 1.01x(?)
ObserverUnappliedMethod 2363 2340 -1.0% 1.01x(?)
ObjectiveCBridgeToNSArray 30710 30539 -0.6% 1.01x(?)
Hanoi 3463 3422 -1.2% 1.01x
SortStringsUnicode 7179 7108 -1.0% 1.01x
ObjectiveCBridgeStubToArrayOfNSString 29872 29649 -0.8% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 4734 4670 -1.4% 1.01x(?)
ObjectiveCBridgeStubNSDataAppend 2458 2430 -1.1% 1.01x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 90283 89065 -1.4% 1.01x(?)
Dictionary2OfObjects 3464 3428 -1.0% 1.01x(?)
ArraySubscript 1441 1441 +0.0% 1.00x
MonteCarloPi 45202 45003 -0.4% 1.00x
StackPromo 21449 21411 -0.2% 1.00x(?)
PopFrontArray 1126 1128 +0.2% 1.00x(?)
RecursiveOwnedParameter 1935 1935 +0.0% 1.00x
Integrate 238 238 +0.0% 1.00x
ClassArrayGetter 12 12 +0.0% 1.00x
DictionaryBridge 3418 3415 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 5466 5447 -0.3% 1.00x(?)
StringWithCString 198689 198797 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 6342 6358 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSStringForced 2669 2671 +0.1% 1.00x(?)
Prims 729 732 +0.4% 1.00x(?)
SortLettersInPlace 1039 1036 -0.3% 1.00x(?)
DictionarySwap 414 413 -0.2% 1.00x(?)
ReversedDictionary 95 95 +0.0% 1.00x
ArrayAppendToFromGeneric 599 599 +0.0% 1.00x
Dictionary3OfObjects 872 871 -0.1% 1.00x(?)
StringHasPrefix 608 608 +0.0% 1.00x
ByteSwap 0 0 +0.0% 1.00x
ArrayAppendGenericStructs 1231 1225 -0.5% 1.00x(?)
SuperChars 211705 210861 -0.4% 1.00x(?)
XorLoop 380 380 +0.0% 1.00x
StringInterpolation 11035 11028 -0.1% 1.00x(?)
ObjectiveCBridgeStubToNSString 1278 1277 -0.1% 1.00x(?)
ArrayAppendStrings 12121 12131 +0.1% 1.00x(?)
StaticArray 129 129 +0.0% 1.00x
ProtocolDispatch 3040 3039 -0.0% 1.00x(?)
TypeFlood 0 0 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObject 80451 80553 +0.1% 1.00x(?)
AngryPhonebook 2830 2817 -0.5% 1.00x(?)
ProtocolDispatch2 158 158 +0.0% 1.00x
Dictionary3 522 520 -0.4% 1.00x(?)
StrComplexWalk 2911 2906 -0.2% 1.00x(?)
SetIntersect_OfObjects 1502 1497 -0.3% 1.00x(?)
ArrayOfRef 3557 3561 +0.1% 1.00x(?)
ArrayPlusEqualArrayOfInt 599 599 +0.0% 1.00x
NSError 325 326 +0.3% 1.00x(?)
DictionaryOfObjects 2272 2278 +0.3% 1.00x(?)
ObjectiveCBridgeStubToNSDateRef 3246 3254 +0.2% 1.00x(?)
CaptureProp 4563 4564 +0.0% 1.00x(?)
RC4 165 165 +0.0% 1.00x
ObjectiveCBridgeStubToNSStringRef 116 116 +0.0% 1.00x
Calculator 34 34 +0.0% 1.00x
ArrayAppendFromGeneric 600 599 -0.2% 1.00x(?)
ArrayAppendOptionals 1239 1235 -0.3% 1.00x(?)
IterateData 2616 2616 +0.0% 1.00x
DictionaryLiteral 1273 1268 -0.4% 1.00x(?)
ArrayOfGenericPOD 220 220 +0.0% 1.00x
UTF8Decode 288 288 +0.0% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 107386 107694 +0.3% 1.00x(?)
SetIsSubsetOf 250 250 +0.0% 1.00x
NopDeinit 21452 21443 -0.0% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObject 74412 74535 +0.2% 1.00x(?)
ObjectiveCBridgeStubDataAppend 3395 3396 +0.0% 1.00x(?)
SetExclusiveOr 2561 2558 -0.1% 1.00x(?)
NSDictionaryCastToSwift 5002 5024 +0.4% 1.00x(?)
ArrayInClass 63 63 +0.0% 1.00x
ArrayOfGenericRef 3678 3692 +0.4% 1.00x(?)
Sim2DArray 277 277 +0.0% 1.00x
ObjectiveCBridgeStubDateMutation 273 273 +0.0% 1.00x
MonteCarloE 10552 10541 -0.1% 1.00x(?)
SetUnion_OfObjects 6200 6230 +0.5% 1.00x(?)
ReversedBidirectional 45041 44861 -0.4% 1.00x(?)
StringHasSuffixUnicode 63422 63197 -0.3% 1.00x(?)
ArrayAppendToGeneric 599 599 +0.0% 1.00x
HashTest 1744 1748 +0.2% 1.00x(?)
SetIsSubsetOf_OfObjects 307 306 -0.3% 1.00x
ObjectiveCBridgeToNSSet 37986 38014 +0.1% 1.00x(?)
DictionaryRemove 2329 2327 -0.1% 1.00x(?)
StringHasPrefixUnicode 14249 14305 +0.4% 1.00x
LinkedList 7210 7209 -0.0% 1.00x(?)
MapReduce 342 342 +0.0% 1.00x
RGBHistogramOfObjects 21387 21383 -0.0% 1.00x(?)
RGBHistogram 2270 2265 -0.2% 1.00x(?)
ArrayAppendArrayOfInt 600 600 +0.0% 1.00x
ArrayOfPOD 182 182 +0.0% 1.00x
SetUnion 2430 2429 -0.0% 1.00x(?)
Chars 629 626 -0.5% 1.00x
DeadArray 185 185 +0.0% 1.00x
BitCount 1 1 +0.0% 1.00x
ArrayLiteral 1196 1202 +0.5% 1.00x(?)
SevenBoom 1352 1348 -0.3% 1.00x(?)
StringWalk 5896 5896 +0.0% 1.00x
ArrayValueProp 6 6 +0.0% 1.00x
GlobalClass 0 0 +0.0% 1.00x
Memset 235 235 +0.0% 1.00x
ArrayValueProp4 6 6 +0.0% 1.00x
TwoSum 1307 1306 -0.1% 1.00x(?)
ArrayValueProp2 6 6 +0.0% 1.00x
ArrayValueProp3 6 6 +0.0% 1.00x
RangeAssignment 288 291 +1.0% 0.99x(?)
ObjectiveCBridgeStubFromNSString 765 769 +0.5% 0.99x(?)
Join 462 468 +1.3% 0.99x(?)
ObjectiveCBridgeStubURLAppendPathRef 234183 236293 +0.9% 0.99x(?)
PopFrontUnsafePointer 9133 9179 +0.5% 0.99x(?)
StringEqualPointerComparison 7301 7343 +0.6% 0.99x(?)
DictionaryRemoveOfObjects 19372 19514 +0.7% 0.99x(?)
Dictionary 720 725 +0.7% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 114491 115748 +1.1% 0.99x(?)
StringBuilder 1319 1332 +1.0% 0.99x(?)
SetExclusiveOr_OfObjects 7383 7450 +0.9% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 81706 82249 +0.7% 0.99x(?)
NSStringConversion 822 829 +0.8% 0.99x(?)
ObserverForwarderStruct 889 899 +1.1% 0.99x(?)
Array2D 2031 2075 +2.2% 0.98x(?)
Histogram 282 287 +1.8% 0.98x
ReversedArray 49 50 +2.0% 0.98x(?)
Walsh 313 320 +2.2% 0.98x
ObjectiveCBridgeFromNSString 1762 1790 +1.6% 0.98x(?)
ObjectiveCBridgeStubFromNSDateRef 3959 4077 +3.0% 0.97x
ObjectiveCBridgeStubFromNSDate 3856 3993 +3.5% 0.97x
ObjectiveCBridgeStubToNSDate 13294 13850 +4.2% 0.96x(?)
ObjectiveCBridgeStubNSDateMutationRef 11960 12510 +4.6% 0.96x(?)
StringHasSuffix 815 845 +3.7% 0.96x
ObjectiveCBridgeStubFromNSStringRef 125 131 +4.8% 0.95x
**Unoptimized (Onone)**
Regression (1)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StrComplexWalk 7410 8088 +9.2% 0.92x
Improvement (4)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StringHasPrefix 1645 1558 -5.3% 1.06x
ObjectiveCBridgeStubDateMutation 459 434 -5.5% 1.06x
StringHasSuffix 1766 1622 -8.2% 1.09x
PopFrontUnsafePointer 180259 162518 -9.8% 1.11x
No Changes (152)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
TypeFlood 187 180 -3.7% 1.04x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 100584 97989 -2.6% 1.03x(?)
ObjectiveCBridgeStubFromArrayOfNSString 59296 57529 -3.0% 1.03x(?)
ObjectiveCBridgeToNSSet 38279 37619 -1.7% 1.02x(?)
ObjectiveCBridgeStubURLAppendPath 237862 233671 -1.8% 1.02x(?)
ObjectiveCBridgeToNSDictionary 62514 61044 -2.4% 1.02x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 92728 90644 -2.2% 1.02x
Histogram 9872 9817 -0.6% 1.01x(?)
ArrayPlusEqualSingleElementCollection 544657 537060 -1.4% 1.01x(?)
ErrorHandling 3829 3798 -0.8% 1.01x(?)
ObserverUnappliedMethod 8812 8766 -0.5% 1.01x(?)
ObjectiveCBridgeStubURLAppendPathRef 239927 238451 -0.6% 1.01x(?)
Calculator 982 971 -1.1% 1.01x
Hanoi 19646 19463 -0.9% 1.01x
SortStringsUnicode 8261 8170 -1.1% 1.01x
ObjectiveCBridgeStubToArrayOfNSString 30040 29798 -0.8% 1.01x(?)
ObjectiveCBridgeFromNSArrayAnyObject 77369 76790 -0.8% 1.01x(?)
Phonebook 20937 20671 -1.3% 1.01x
RGBHistogram 34728 34485 -0.7% 1.01x
StrToInt 5768 5738 -0.5% 1.01x(?)
DeadArray 121781 120587 -1.0% 1.01x(?)
ArraySubscript 5621 5621 +0.0% 1.00x
ObjectiveCBridgeToNSString 1105 1101 -0.4% 1.00x(?)
StackPromo 130797 130549 -0.2% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 172589 172210 -0.2% 1.00x(?)
RecursiveOwnedParameter 10952 10953 +0.0% 1.00x(?)
Integrate 365 365 +0.0% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 186776 187696 +0.5% 1.00x(?)
ClassArrayGetter 1276 1275 -0.1% 1.00x(?)
Array2D 815112 815580 +0.1% 1.00x(?)
DictionaryBridge 3490 3483 -0.2% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7880 7889 +0.1% 1.00x(?)
MonteCarloPi 53652 53574 -0.1% 1.00x(?)
StringWithCString 152893 153038 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSStringForced 3097 3105 +0.3% 1.00x
Prims 12706 12704 -0.0% 1.00x(?)
SortLettersInPlace 2678 2681 +0.1% 1.00x(?)
ReversedDictionary 33014 32938 -0.2% 1.00x(?)
ArrayAppendToFromGeneric 717 718 +0.1% 1.00x(?)
PopFrontArray 13633 13620 -0.1% 1.00x(?)
ArrayOfGenericPOD 3068 3075 +0.2% 1.00x(?)
Dictionary3OfObjects 2149 2150 +0.1% 1.00x(?)
RangeAssignment 7167 7176 +0.1% 1.00x(?)
ByteSwap 9 9 +0.0% 1.00x
SuperChars 266261 265673 -0.2% 1.00x(?)
ArrayAppendLazyMap 264032 264001 -0.0% 1.00x(?)
ObjectiveCBridgeStubToNSDate 14036 14034 -0.0% 1.00x(?)
XorLoop 19998 20002 +0.0% 1.00x(?)
ArrayAppendReserved 3105 3105 +0.0% 1.00x
StringInterpolation 15828 15773 -0.3% 1.00x(?)
ObserverClosure 7038 7049 +0.2% 1.00x(?)
ObjectiveCBridgeStubToNSString 1337 1337 +0.0% 1.00x
ArrayAppendStrings 11881 11912 +0.3% 1.00x(?)
ObjectiveCBridgeStubFromNSStringRef 156 156 +0.0% 1.00x
StaticArray 3725 3720 -0.1% 1.00x(?)
ProtocolDispatch 6116 6117 +0.0% 1.00x(?)
ObjectAllocation 555 556 +0.2% 1.00x(?)
ProtocolDispatch2 441 441 +0.0% 1.00x
Walsh 13225 13217 -0.1% 1.00x(?)
Dictionary3 1389 1383 -0.4% 1.00x(?)
Dictionary2 3662 3648 -0.4% 1.00x(?)
SetIntersect_OfObjects 11858 11883 +0.2% 1.00x(?)
Join 1483 1490 +0.5% 1.00x(?)
ArrayOfRef 8942 8929 -0.1% 1.00x(?)
ArrayPlusEqualArrayOfInt 715 717 +0.3% 1.00x(?)
DictionaryOfObjects 4629 4614 -0.3% 1.00x(?)
ObjectiveCBridgeStubToNSDateRef 3345 3350 +0.1% 1.00x(?)
PopFrontArrayGeneric 9607 9563 -0.5% 1.00x
StringEqualPointerComparison 9631 9626 -0.1% 1.00x(?)
PolymorphicCalls 689 689 +0.0% 1.00x
RC4 9377 9381 +0.0% 1.00x(?)
ObjectiveCBridgeStubToNSStringRef 155 155 +0.0% 1.00x
ArrayAppendFromGeneric 716 719 +0.4% 1.00x(?)
MapReduce 44901 44833 -0.1% 1.00x
IterateData 10073 10072 -0.0% 1.00x(?)
DictionaryLiteral 15904 15855 -0.3% 1.00x(?)
OpenClose 409 408 -0.2% 1.00x(?)
DictionaryRemoveOfObjects 48072 47958 -0.2% 1.00x(?)
UTF8Decode 45689 45685 -0.0% 1.00x(?)
SetIsSubsetOf 1912 1913 +0.1% 1.00x(?)
NopDeinit 44834 45036 +0.5% 1.00x(?)
SetIntersect 11099 11083 -0.1% 1.00x(?)
ObjectiveCBridgeStubDataAppend 3490 3481 -0.3% 1.00x(?)
NSDictionaryCastToSwift 6134 6156 +0.4% 1.00x(?)
ArrayAppendOptionals 1375 1370 -0.4% 1.00x(?)
ArrayInClass 3956 3957 +0.0% 1.00x(?)
ArrayOfGenericRef 9950 9951 +0.0% 1.00x(?)
ObjectiveCBridgeFromNSString 4586 4591 +0.1% 1.00x(?)
Sim2DArray 14770 14781 +0.1% 1.00x(?)
SetExclusiveOr_OfObjects 39576 39522 -0.1% 1.00x(?)
ArrayAppendRepeatCol 214899 214114 -0.4% 1.00x(?)
MonteCarloE 108524 108511 -0.0% 1.00x(?)
SetUnion_OfObjects 28429 28306 -0.4% 1.00x(?)
ReversedBidirectional 130839 130913 +0.1% 1.00x(?)
StringHasSuffixUnicode 65114 65139 +0.0% 1.00x(?)
ArrayAppendToGeneric 718 719 +0.1% 1.00x(?)
HashTest 5488 5495 +0.1% 1.00x(?)
SetIsSubsetOf_OfObjects 1894 1888 -0.3% 1.00x(?)
ArrayAppend 3337 3339 +0.1% 1.00x(?)
DictionaryRemove 17728 17774 +0.3% 1.00x(?)
StringHasPrefixUnicode 15742 15772 +0.2% 1.00x(?)
LinkedList 27707 27767 +0.2% 1.00x(?)
156 6852134 6863275 +0.2% 1.00x
RGBHistogramOfObjects 83278 83069 -0.2% 1.00x(?)
ArrayLiteral 1252 1248 -0.3% 1.00x(?)
NSStringConversion 1397 1402 +0.4% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 7507 7478 -0.4% 1.00x(?)
ArrayAppendSequence 84646 84639 -0.0% 1.00x(?)
ArrayAppendArrayOfInt 715 715 +0.0% 1.00x
ArrayOfPOD 1898 1900 +0.1% 1.00x(?)
SetUnion 11968 11961 -0.1% 1.00x(?)
ReversedArray 522 523 +0.2% 1.00x(?)
ObserverForwarderStruct 5281 5282 +0.0% 1.00x(?)
ObjectiveCBridgeStubNSDateRefAccess 1197 1196 -0.1% 1.00x(?)
ObjectiveCBridgeStubNSDataAppend 2818 2823 +0.2% 1.00x(?)
BitCount 96 96 +0.0% 1.00x
SevenBoom 1512 1509 -0.2% 1.00x(?)
ArrayValueProp 2617 2620 +0.1% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 20983 20954 -0.1% 1.00x(?)
Dictionary2OfObjects 5966 5990 +0.4% 1.00x(?)
ArrayValueProp4 3010 3014 +0.1% 1.00x(?)
ArrayValueProp2 3140 3138 -0.1% 1.00x(?)
ArrayValueProp3 3055 3067 +0.4% 1.00x(?)
DictionarySwapOfObjects 19930 20065 +0.7% 0.99x(?)
ObjectiveCBridgeStubFromNSDateRef 4086 4107 +0.5% 0.99x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 10415 10506 +0.9% 0.99x(?)
DictionarySwap 6108 6163 +0.9% 0.99x
ArrayAppendGenericStructs 1381 1389 +0.6% 0.99x
ObjectiveCBridgeStubFromNSString 782 789 +0.9% 0.99x(?)
SortSortedStrings 1244 1260 +1.3% 0.99x
ObjectiveCBridgeFromNSSetAnyObject 85464 86522 +1.2% 0.99x(?)
AnyHashableWithAClass 79308 79897 +0.7% 0.99x
NSError 684 692 +1.2% 0.99x(?)
CaptureProp 101691 102418 +0.7% 0.99x(?)
Dictionary 1862 1875 +0.7% 0.99x(?)
SetExclusiveOr 20721 20912 +0.9% 0.99x(?)
StringBuilder 2717 2733 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 87730 88620 +1.0% 0.99x(?)
Chars 6439 6532 +1.4% 0.99x
AngryPhonebook 3005 3030 +0.8% 0.99x(?)
TwoSum 4832 4877 +0.9% 0.99x
ObserverPartiallyAppliedMethod 8390 8455 +0.8% 0.99x(?)
ArrayPlusEqualFiveElementCollection 541358 551957 +2.0% 0.98x(?)
ObjectiveCBridgeToNSArray 30297 31042 +2.5% 0.98x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 112369 114174 +1.6% 0.98x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 125201 127745 +2.0% 0.98x(?)
ObjectiveCBridgeStubFromNSDate 3704 3774 +1.9% 0.98x
SortStrings 2442 2509 +2.7% 0.97x
ObjectiveCBridgeStubNSDateMutationRef 14399 14965 +3.9% 0.96x(?)
ObjectiveCBridgeStubDateAccess 1064 1122 +5.5% 0.95x
StringWalk 20371 21349 +4.8% 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

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (9)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ArrayAppendLazyMap 862 4923 +471.1% 0.18x
ArrayAppendReserved 505 815 +61.4% 0.62x
ArrayAppend 732 1160 +58.5% 0.63x
ArrayAppendRepeatCol 716 869 +21.4% 0.82x
ObjectiveCBridgeStubDateAccess 172 200 +16.3% 0.86x
PopFrontArrayGeneric 1060 1196 +12.8% 0.89x(?)
PopFrontUnsafePointer 8608 9474 +10.1% 0.91x
ArrayAppendSequence 1308 1414 +8.1% 0.93x
ObserverForwarderStruct 920 994 +8.0% 0.93x(?)
Improvement (7)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StrToInt 4925 4652 -5.5% 1.06x
Calculator 32 30 -6.2% 1.07x
ClassArrayGetter 12 11 -8.3% 1.09x(?)
ObjectiveCBridgeStubNSDateRefAccess 320 291 -9.1% 1.10x
OpenClose 51 45 -11.8% 1.13x
ArrayPlusEqualFiveElementCollection 48820 7068 -85.5% 6.91x
ArrayPlusEqualSingleElementCollection 45669 2075 -95.5% 22.01x
No Changes (141)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
Walsh 306 292 -4.6% 1.05x
ObserverClosure 1830 1767 -3.4% 1.04x
Phonebook 7057 6819 -3.4% 1.03x
Chars 594 578 -2.7% 1.03x
AnyHashableWithAClass 62278 60841 -2.3% 1.02x
StaticArray 124 122 -1.6% 1.02x(?)
ObjectiveCBridgeStubNSDataAppend 2300 2252 -2.1% 1.02x(?)
ObserverPartiallyAppliedMethod 3167 3092 -2.4% 1.02x
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 5171 5142 -0.6% 1.01x(?)
DictionarySwapOfObjects 5895 5843 -0.9% 1.01x(?)
StringInterpolation 10417 10264 -1.5% 1.01x(?)
ErrorHandling 2763 2724 -1.4% 1.01x(?)
ObjectiveCBridgeStubFromNSString 737 728 -1.2% 1.01x(?)
ObjectAllocation 145 144 -0.7% 1.01x(?)
SortSortedStrings 786 775 -1.4% 1.01x
AngryPhonebook 2673 2650 -0.9% 1.01x
ObjectiveCBridgeToNSArray 28999 28631 -1.3% 1.01x(?)
ObjectiveCBridgeStubToNSStringRef 110 109 -0.9% 1.01x(?)
IterateData 2472 2459 -0.5% 1.01x
Hanoi 3266 3227 -1.2% 1.01x
ObjectiveCBridgeStubToArrayOfNSString 28425 28178 -0.9% 1.01x(?)
SetIntersect 337 334 -0.9% 1.01x(?)
SetExclusiveOr 2427 2405 -0.9% 1.01x(?)
NSDictionaryCastToSwift 4691 4658 -0.7% 1.01x(?)
ArrayOfGenericRef 3476 3444 -0.9% 1.01x(?)
SetExclusiveOr_OfObjects 6985 6950 -0.5% 1.01x(?)
HashTest 1641 1632 -0.6% 1.01x(?)
RGBHistogram 2143 2127 -0.8% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 4481 4418 -1.4% 1.01x(?)
Dictionary2OfObjects 3251 3219 -1.0% 1.01x(?)
TwoSum 1250 1240 -0.8% 1.01x(?)
ArraySubscript 1351 1350 -0.1% 1.00x(?)
MonteCarloPi 42640 42487 -0.4% 1.00x
StackPromo 20167 20158 -0.0% 1.00x(?)
PopFrontArray 1042 1040 -0.2% 1.00x(?)
RecursiveOwnedParameter 1827 1826 -0.1% 1.00x(?)
Integrate 225 225 +0.0% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 163307 162788 -0.3% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 91332 91285 -0.1% 1.00x(?)
SortStrings 1560 1557 -0.2% 1.00x(?)
StringWithCString 146935 146842 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 5985 5999 +0.2% 1.00x(?)
Prims 689 689 +0.0% 1.00x
SortLettersInPlace 979 978 -0.1% 1.00x(?)
DictionarySwap 389 389 +0.0% 1.00x
ReversedDictionary 79 79 +0.0% 1.00x
ArrayAppendToFromGeneric 565 565 +0.0% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObject 154597 155175 +0.4% 1.00x(?)
Dictionary3OfObjects 819 820 +0.1% 1.00x(?)
StringHasPrefix 574 574 +0.0% 1.00x
ByteSwap 0 0 +0.0% 1.00x
ArrayAppendGenericStructs 1140 1141 +0.1% 1.00x(?)
SuperChars 199328 199468 +0.1% 1.00x(?)
XorLoop 358 358 +0.0% 1.00x
ArrayAppendStrings 11400 11408 +0.1% 1.00x(?)
ProtocolDispatch 3438 3438 +0.0% 1.00x
TypeFlood 0 0 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObject 75954 75978 +0.0% 1.00x(?)
ProtocolDispatch2 148 148 +0.0% 1.00x
Dictionary3 492 492 +0.0% 1.00x
Dictionary2 1923 1914 -0.5% 1.00x(?)
StrComplexWalk 2743 2741 -0.1% 1.00x(?)
SetIntersect_OfObjects 1410 1410 +0.0% 1.00x
ArrayOfRef 3349 3333 -0.5% 1.00x(?)
ObserverUnappliedMethod 2176 2182 +0.3% 1.00x(?)
ArrayPlusEqualArrayOfInt 565 565 +0.0% 1.00x
NSError 305 305 +0.0% 1.00x
DictionaryOfObjects 2151 2154 +0.1% 1.00x(?)
StringEqualPointerComparison 6868 6891 +0.3% 1.00x(?)
CaptureProp 4308 4306 -0.1% 1.00x(?)
PolymorphicCalls 20 20 +0.0% 1.00x
RC4 156 156 +0.0% 1.00x
ArrayAppendFromGeneric 565 565 +0.0% 1.00x
ObjectiveCBridgeStubDateMutation 258 258 +0.0% 1.00x
DictionaryLiteral 1195 1196 +0.1% 1.00x(?)
ArrayOfGenericPOD 207 207 +0.0% 1.00x
UTF8Decode 272 272 +0.0% 1.00x
ObjectiveCBridgeStubURLAppendPath 218711 217848 -0.4% 1.00x(?)
SetIsSubsetOf 236 236 +0.0% 1.00x
NopDeinit 20234 20221 -0.1% 1.00x(?)
ArrayAppendOptionals 1142 1142 +0.0% 1.00x
StringBuilder 1238 1243 +0.4% 1.00x
Sim2DArray 261 261 +0.0% 1.00x
ObjectiveCBridgeToNSDictionary 57464 57364 -0.2% 1.00x(?)
MonteCarloE 9964 9929 -0.3% 1.00x(?)
SetUnion_OfObjects 5815 5824 +0.1% 1.00x(?)
ReversedBidirectional 42231 42337 +0.2% 1.00x(?)
StringHasSuffixUnicode 59561 59461 -0.2% 1.00x(?)
ArrayAppendToGeneric 565 565 +0.0% 1.00x
SetIsSubsetOf_OfObjects 289 289 +0.0% 1.00x
ObjectiveCBridgeToNSSet 35462 35288 -0.5% 1.00x(?)
DictionaryRemove 2203 2214 +0.5% 1.00x(?)
LinkedList 6804 6803 -0.0% 1.00x(?)
156 2767175 2779712 +0.5% 1.00x
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 75989 76085 +0.1% 1.00x(?)
RGBHistogramOfObjects 20172 20133 -0.2% 1.00x(?)
ArrayAppendArrayOfInt 565 566 +0.2% 1.00x(?)
ArrayOfPOD 171 171 +0.0% 1.00x
SetUnion 2298 2289 -0.4% 1.00x(?)
ReversedArray 46 46 +0.0% 1.00x
DeadArray 174 174 +0.0% 1.00x
BitCount 1 1 +0.0% 1.00x
ArrayLiteral 1111 1110 -0.1% 1.00x(?)
SevenBoom 1267 1267 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 84558 84208 -0.4% 1.00x(?)
StringWalk 5565 5566 +0.0% 1.00x(?)
ArrayValueProp 5 5 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 54162 54205 +0.1% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 222 222 +0.0% 1.00x
ArrayValueProp4 5 5 +0.0% 1.00x
ArrayValueProp2 5 5 +0.0% 1.00x
ArrayValueProp3 5 5 +0.0% 1.00x
ObjectiveCBridgeToNSString 1007 1014 +0.7% 0.99x
Histogram 266 269 +1.1% 0.99x
DictionaryBridge 3177 3198 +0.7% 0.99x(?)
ObjectiveCBridgeFromNSStringForced 2520 2543 +0.9% 0.99x(?)
RangeAssignment 272 275 +1.1% 0.99x(?)
ObjectiveCBridgeStubToNSString 1202 1209 +0.6% 0.99x(?)
Join 434 438 +0.9% 0.99x
ObjectiveCBridgeStubURLAppendPathRef 215506 216851 +0.6% 0.99x(?)
DictionaryRemoveOfObjects 18241 18486 +1.3% 0.99x(?)
SortStringsUnicode 6779 6829 +0.7% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 101446 102242 +0.8% 0.99x(?)
Dictionary 686 690 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSArrayAnyObject 69871 70488 +0.9% 0.99x(?)
ObjectiveCBridgeStubDataAppend 3212 3233 +0.7% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 108822 109372 +0.5% 0.99x(?)
StringHasPrefixUnicode 13211 13289 +0.6% 0.99x
MapReduce 322 324 +0.6% 0.99x
ObjectiveCBridgeFromNSString 1684 1702 +1.1% 0.99x(?)
Array2D 1933 1971 +2.0% 0.98x(?)
ObjectiveCBridgeStubToNSDate 12632 12913 +2.2% 0.98x(?)
ObjectiveCBridgeStubToNSDateRef 3026 3098 +2.4% 0.98x(?)
ArrayInClass 59 60 +1.7% 0.98x(?)
ObjectiveCBridgeStubNSDateMutationRef 11201 11484 +2.5% 0.98x(?)
NSStringConversion 760 773 +1.7% 0.98x(?)
ObjectiveCBridgeStubFromNSDate 3641 3713 +2.0% 0.98x
ObjectiveCBridgeStubFromNSDateRef 3736 3844 +2.9% 0.97x
ObjectiveCBridgeStubFromNSStringRef 118 122 +3.4% 0.97x
StringHasSuffix 772 804 +4.2% 0.96x
**Unoptimized (Onone)**
Regression (3)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
PopFrontUnsafePointer 153522 170107 +10.8% 0.90x
StringHasSuffix 1514 1673 +10.5% 0.90x
TypeFlood 170 182 +7.1% 0.93x(?)
Improvement (2)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ObjectiveCBridgeStubDateMutation 434 410 -5.5% 1.06x
StrComplexWalk 7633 6973 -8.7% 1.09x
No Changes (152)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StringWalk 20274 19351 -4.5% 1.05x
Dictionary 1820 1746 -4.1% 1.04x
Chars 6300 6061 -3.8% 1.04x
ObjectiveCBridgeStubToNSDate 13325 12900 -3.2% 1.03x(?)
DictionaryLiteral 15497 14986 -3.3% 1.03x
ArrayValueProp4 2921 2844 -2.6% 1.03x
ObjectiveCBridgeStubFromArrayOfNSString 55944 54453 -2.7% 1.03x(?)
ObjectiveCBridgeStubNSDateMutationRef 13730 13366 -2.6% 1.03x(?)
ClassArrayGetter 1229 1203 -2.1% 1.02x
DictionaryBridge 3374 3298 -2.2% 1.02x(?)
Dictionary3OfObjects 2056 2008 -2.3% 1.02x
Dictionary3 1337 1309 -2.1% 1.02x
Dictionary2 3528 3460 -1.9% 1.02x
OpenClose 378 371 -1.9% 1.02x
NSError 654 640 -2.1% 1.02x(?)
DictionaryOfObjects 4446 4349 -2.2% 1.02x
NSDictionaryCastToSwift 5869 5745 -2.1% 1.02x(?)
ObjectiveCBridgeToNSDictionary 58401 56979 -2.4% 1.02x(?)
StringBuilder 2619 2574 -1.7% 1.02x(?)
DeadArray 115559 113560 -1.7% 1.02x(?)
BitCount 93 91 -2.1% 1.02x
Dictionary2OfObjects 5720 5596 -2.2% 1.02x(?)
Histogram 9342 9282 -0.6% 1.01x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7512 7438 -1.0% 1.01x(?)
PopFrontArray 12878 12770 -0.8% 1.01x(?)
StringInterpolation 14951 14876 -0.5% 1.01x(?)
ObjectiveCBridgeStubFromNSString 759 754 -0.7% 1.01x(?)
ObjectAllocation 523 520 -0.6% 1.01x(?)
StringEqualPointerComparison 9174 9123 -0.6% 1.01x
CaptureProp 97931 96762 -1.2% 1.01x
ObjectiveCBridgeStubToArrayOfNSString 28501 28354 -0.5% 1.01x(?)
ObjectiveCBridgeStubDataAppend 3308 3281 -0.8% 1.01x(?)
ArrayOfGenericRef 9404 9323 -0.9% 1.01x
ObjectiveCBridgeFromNSString 4328 4289 -0.9% 1.01x(?)
Phonebook 19925 19752 -0.9% 1.01x
SetIsSubsetOf_OfObjects 1796 1785 -0.6% 1.01x(?)
DictionaryRemove 17056 16870 -1.1% 1.01x
RGBHistogram 32693 32509 -0.6% 1.01x(?)
ArrayAppendSequence 79710 78841 -1.1% 1.01x
ObjectiveCBridgeStubNSDataAppend 2695 2662 -1.2% 1.01x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 86154 85411 -0.9% 1.01x(?)
TwoSum 4573 4534 -0.8% 1.01x(?)
ArraySubscript 5313 5309 -0.1% 1.00x(?)
ObjectiveCBridgeToNSString 1037 1041 +0.4% 1.00x(?)
DictionarySwapOfObjects 18926 18967 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 161459 161697 +0.1% 1.00x(?)
RecursiveOwnedParameter 10299 10318 +0.2% 1.00x(?)
Integrate 348 347 -0.3% 1.00x
ObjectiveCBridgeFromNSArrayAnyObjectToString 93448 93089 -0.4% 1.00x(?)
Array2D 768568 769410 +0.1% 1.00x(?)
SortStrings 2351 2343 -0.3% 1.00x(?)
ObjectiveCBridgeStubFromNSDateRef 3873 3875 +0.1% 1.00x(?)
MonteCarloPi 50553 50554 +0.0% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 9985 9974 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSStringForced 2929 2935 +0.2% 1.00x(?)
Prims 12005 11983 -0.2% 1.00x(?)
SortLettersInPlace 2526 2520 -0.2% 1.00x(?)
DictionarySwap 5836 5851 +0.3% 1.00x(?)
ReversedDictionary 30318 30350 +0.1% 1.00x(?)
ArrayAppendToFromGeneric 677 675 -0.3% 1.00x(?)
RangeAssignment 6755 6755 +0.0% 1.00x
ByteSwap 9 9 +0.0% 1.00x
ArrayAppendGenericStructs 1259 1260 +0.1% 1.00x(?)
SuperChars 252527 251381 -0.5% 1.00x(?)
ArrayAppendLazyMap 249353 248729 -0.2% 1.00x(?)
ArrayPlusEqualFiveElementCollection 511122 512817 +0.3% 1.00x(?)
XorLoop 18860 18870 +0.1% 1.00x(?)
ObserverClosure 6615 6597 -0.3% 1.00x(?)
ObjectiveCBridgeStubToNSString 1259 1258 -0.1% 1.00x(?)
ArrayPlusEqualSingleElementCollection 499299 501187 +0.4% 1.00x(?)
ArrayAppendStrings 11122 11142 +0.2% 1.00x(?)
ObjectiveCBridgeStubFromNSStringRef 148 148 +0.0% 1.00x
StaticArray 3501 3493 -0.2% 1.00x(?)
ProtocolDispatch 5769 5768 -0.0% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObject 80751 80607 -0.2% 1.00x(?)
ProtocolDispatch2 416 416 +0.0% 1.00x
Walsh 12411 12461 +0.4% 1.00x(?)
ErrorHandling 3559 3545 -0.4% 1.00x(?)
ArrayOfRef 8431 8406 -0.3% 1.00x(?)
ObserverUnappliedMethod 8174 8206 +0.4% 1.00x(?)
ObjectiveCBridgeStubURLAppendPathRef 222892 222203 -0.3% 1.00x(?)
ObjectiveCBridgeToNSSet 36097 36055 -0.1% 1.00x(?)
ArrayPlusEqualArrayOfInt 674 674 +0.0% 1.00x
ObjectiveCBridgeToNSArray 29224 29096 -0.4% 1.00x(?)
ObjectiveCBridgeStubToNSDateRef 3148 3148 +0.0% 1.00x
PopFrontArrayGeneric 9059 9047 -0.1% 1.00x(?)
PolymorphicCalls 649 650 +0.1% 1.00x(?)
RC4 8847 8855 +0.1% 1.00x(?)
ObjectiveCBridgeStubToNSStringRef 147 147 +0.0% 1.00x
Calculator 937 939 +0.2% 1.00x(?)
ArrayAppendFromGeneric 678 676 -0.3% 1.00x
MapReduce 42246 42283 +0.1% 1.00x(?)
Hanoi 18398 18470 +0.4% 1.00x(?)
ArrayOfGenericPOD 3052 3047 -0.2% 1.00x(?)
DictionaryRemoveOfObjects 45229 45239 +0.0% 1.00x(?)
UTF8Decode 43114 43054 -0.1% 1.00x(?)
ObjectiveCBridgeStubURLAppendPath 218302 218201 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 106301 106352 +0.1% 1.00x(?)
SetIsSubsetOf 1801 1805 +0.2% 1.00x(?)
SetIntersect 10465 10457 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 120984 121010 +0.0% 1.00x(?)
ArrayAppendOptionals 1258 1258 +0.0% 1.00x
ArrayInClass 3733 3734 +0.0% 1.00x(?)
Sim2DArray 13947 13948 +0.0% 1.00x(?)
SetExclusiveOr_OfObjects 37212 37355 +0.4% 1.00x(?)
MonteCarloE 102439 102435 -0.0% 1.00x(?)
SetUnion_OfObjects 26679 26701 +0.1% 1.00x(?)
ReversedBidirectional 123301 123105 -0.2% 1.00x(?)
ArrayAppendToGeneric 677 677 +0.0% 1.00x
HashTest 5174 5166 -0.1% 1.00x(?)
ArrayAppend 3129 3121 -0.3% 1.00x
StringHasPrefixUnicode 14520 14577 +0.4% 1.00x
LinkedList 26133 26125 -0.0% 1.00x(?)
RGBHistogramOfObjects 78393 78321 -0.1% 1.00x(?)
NSStringConversion 1271 1265 -0.5% 1.00x
ObjectiveCBridgeFromNSSetAnyObjectForced 7099 7074 -0.3% 1.00x(?)
ArrayAppendArrayOfInt 675 673 -0.3% 1.00x
ArrayOfPOD 1791 1790 -0.1% 1.00x(?)
SetUnion 11337 11363 +0.2% 1.00x(?)
ReversedArray 493 492 -0.2% 1.00x(?)
ObserverForwarderStruct 4939 4947 +0.2% 1.00x(?)
ObjectiveCBridgeStubNSDateRefAccess 1131 1130 -0.1% 1.00x(?)
AnyHashableWithAClass 76627 76714 +0.1% 1.00x
SevenBoom 1412 1413 +0.1% 1.00x(?)
ArrayValueProp 2466 2461 -0.2% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 19789 19775 -0.1% 1.00x(?)
ArrayAppendReserved 2926 2928 +0.1% 1.00x(?)
ArrayValueProp2 2966 2964 -0.1% 1.00x(?)
ObserverPartiallyAppliedMethod 7895 7861 -0.4% 1.00x(?)
StackPromo 119178 120873 +1.4% 0.99x(?)
StringWithCString 144121 144917 +0.6% 0.99x
Join 1393 1408 +1.1% 0.99x(?)
SortSortedStrings 1181 1191 +0.8% 0.99x
AngryPhonebook 2808 2826 +0.6% 0.99x(?)
SetIntersect_OfObjects 11174 11241 +0.6% 0.99x(?)
IterateData 9448 9520 +0.8% 0.99x(?)
SortStringsUnicode 7701 7751 +0.7% 0.99x
NopDeinit 42264 42516 +0.6% 0.99x(?)
SetExclusiveOr 19776 19890 +0.6% 0.99x(?)
ArrayAppendRepeatCol 201729 202846 +0.6% 0.99x(?)
StringHasSuffixUnicode 61144 61749 +1.0% 0.99x
156 6470423 6515948 +0.7% 0.99x
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 82234 82880 +0.8% 0.99x(?)
ArrayLiteral 1170 1176 +0.5% 0.99x(?)
ArrayValueProp3 2880 2897 +0.6% 0.99x(?)
ObjectiveCBridgeStubFromNSDate 3503 3554 +1.5% 0.99x
ObjectiveCBridgeFromNSArrayAnyObject 71765 73140 +1.9% 0.98x(?)
StrToInt 5381 5488 +2.0% 0.98x
StringHasPrefix 1467 1525 +4.0% 0.96x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 168443 176822 +5.0% 0.95x(?)
ObjectiveCBridgeStubDateAccess 1004 1060 +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

@ben-ng
Copy link
Author

ben-ng commented Jan 12, 2017

Good thing we ran that benchmark on this, those are surprising results.

Not only were there quite a few regressions, it looks like the "magic number" where this optimization should bail out is actually around 23.

@eeckstein
Copy link
Contributor

Not only were there quite a few regressions, it looks like the "magic number" where this optimization should bail out is actually around 23.

@ben-ng Are you referring to the max number of elements? We should also take care about code size. Even if the performance is okay, we should have a reasonable low limit to prevent code size explosion.

@gottesmm
Copy link
Contributor

@eeckstein @ben-ng Another question to consider is can this number change over time? If the number changes over time, do we have any tests that vary the number so that we can verify this?

I imagine the way to do it would be to have a gybed extension, no?

@ben-ng ben-ng force-pushed the bng-siloptimizer-array-append branch from 75b6dba to e69ff06 Compare March 4, 2017 20:01
@ben-ng
Copy link
Author

ben-ng commented Mar 4, 2017

Can I please get another benchmark run on this?

@eeckstein
Copy link
Contributor

@swift-ci Please benchmark

@gottesmm
Copy link
Contributor

gottesmm commented Mar 5, 2017

I'll give you 2 ; )

@gottesmm
Copy link
Contributor

gottesmm commented Mar 5, 2017

@swift-ci Please benchmark

@gottesmm
Copy link
Contributor

gottesmm commented Mar 5, 2017

Hmmm... I thought we could run multiple benchmarking jobs at the same time. Guess not. Sorry for restarting the timer on the benchmarking job!

@swift-ci
Copy link
Contributor

swift-ci commented Mar 5, 2017

Build comment file:

Optimized (O)

Regression (6)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ArrayValueProp2 5 125 +2399.5% 0.04x
ArrayValueProp3 5 125 +2399.5% 0.04x
ArrayValueProp4 5 125 +2399.5% 0.04x
ArrayValueProp 5 125 +2399.5% 0.04x
StringBuilder 1283 1708 +33.1% 0.75x
ClassArrayGetter 12 13 +8.3% 0.92x
Improvement (1)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
PopFrontArrayGeneric 1099 1030 -6.3% 1.07x(?)
No Changes (167)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ObjectiveCBridgeStubNSDateRefAccess 336 323 -3.9% 1.04x
StringWalk 5752 5533 -3.8% 1.04x
MapReduceString 76 74 -2.6% 1.03x
ObjectiveCBridgeStubNSDateMutationRef 12011 11675 -2.8% 1.03x(?)
SetExclusiveOr_OfObjects 7527 7412 -1.5% 1.02x(?)
ObjectiveCBridgeStubToNSDateRef 3164 3105 -1.9% 1.02x(?)
SetUnion_OfObjects 6076 5980 -1.6% 1.02x
StackPromo 23178 23051 -0.6% 1.01x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 4684 4648 -0.8% 1.01x(?)
PopFrontArray 1133 1125 -0.7% 1.01x(?)
RangeAssignment 306 303 -1.0% 1.01x(?)
ObjectiveCBridgeStubFromNSString 918 908 -1.1% 1.01x(?)
MapReduceSequence 582 577 -0.9% 1.01x(?)
ArrayAppendUTF16 39294 39018 -0.7% 1.01x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 91538 90895 -0.7% 1.01x(?)
ObjectiveCBridgeToNSDictionary 56405 56088 -0.6% 1.01x(?)
ObserverPartiallyAppliedMethod 3563 3540 -0.7% 1.01x(?)
ArraySubscript 1466 1463 -0.2% 1.00x(?)
ObjectiveCBridgeToNSString 1198 1197 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 111553 111802 +0.2% 1.00x(?)
ObjectiveCBridgeStubToNSString 1435 1434 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 40507 40422 -0.2% 1.00x(?)
Array2D 1835 1843 +0.4% 1.00x(?)
SortStrings 1621 1626 +0.3% 1.00x(?)
ProtocolDispatch2 141 141 +0.0% 1.00x
MonteCarloPi 42466 42466 +0.0% 1.00x
StringWithCString 146735 146821 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 4196 4188 -0.2% 1.00x(?)
ObjectiveCBridgeFromNSStringForced 2197 2189 -0.4% 1.00x(?)
Prims 738 737 -0.1% 1.00x(?)
SortLettersInPlace 1088 1088 +0.0% 1.00x
DictionarySwap 350 350 +0.0% 1.00x
ReversedDictionary 110 110 +0.0% 1.00x
ArrayAppendToFromGeneric 563 564 +0.2% 1.00x(?)
Dictionary3OfObjects 957 958 +0.1% 1.00x(?)
MapReduceLazyCollectionShort 57 57 +0.0% 1.00x
ByteSwap 0 0 +0.0% 1.00x
ArrayAppendGenericStructs 1136 1136 +0.0% 1.00x
SuperChars 208390 208426 +0.0% 1.00x(?)
ArrayAppendLazyMap 862 861 -0.1% 1.00x(?)
ArrayPlusEqualFiveElementCollection 56413 56531 +0.2% 1.00x(?)
XorLoop 333 333 +0.0% 1.00x
StringInterpolation 8925 8904 -0.2% 1.00x(?)
ObserverClosure 2101 2095 -0.3% 1.00x(?)
AnyHashableWithAClass 63383 63590 +0.3% 1.00x(?)
CharacterLiteralsSmall 758 760 +0.3% 1.00x(?)
Integrate 247 247 +0.0% 1.00x
ArrayPlusEqualSingleElementCollection 54101 53860 -0.5% 1.00x(?)
ArrayAppendStrings 12775 12742 -0.3% 1.00x(?)
ObjectiveCBridgeStubFromNSStringRef 195 195 +0.0% 1.00x
StaticArray 137 137 +0.0% 1.00x
ProtocolDispatch 3196 3206 +0.3% 1.00x(?)
TypeFlood 0 0 +0.0% 1.00x
SortSortedStrings 832 829 -0.4% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObject 60117 59868 -0.4% 1.00x(?)
ArrayLiteral 1325 1328 +0.2% 1.00x(?)
ArrayAppendLatin1 42263 42121 -0.3% 1.00x(?)
CharacterLiteralsLarge 11533 11553 +0.2% 1.00x(?)
Walsh 336 335 -0.3% 1.00x(?)
Dictionary3 559 561 +0.4% 1.00x(?)
Dictionary2 2019 2016 -0.1% 1.00x(?)
SetIntersect_OfObjects 1627 1627 +0.0% 1.00x
Join 460 460 +0.0% 1.00x
ArrayOfRef 3691 3685 -0.2% 1.00x(?)
ObserverUnappliedMethod 2529 2518 -0.4% 1.00x(?)
ObjectiveCBridgeToNSSet 33939 34047 +0.3% 1.00x(?)
ArrayAppendOptionals 1136 1137 +0.1% 1.00x(?)
OpenClose 48 48 +0.0% 1.00x
ObjectiveCBridgeToNSArray 26954 26986 +0.1% 1.00x(?)
NSError 327 327 +0.0% 1.00x
DictionaryOfObjects 2421 2421 +0.0% 1.00x
PopFrontUnsafePointer 9090 9084 -0.1% 1.00x(?)
StringEqualPointerComparison 6900 6899 -0.0% 1.00x(?)
CaptureProp 763 763 +0.0% 1.00x
RC4 149 149 +0.0% 1.00x
ObjectiveCBridgeStubToNSStringRef 122 122 +0.0% 1.00x
Calculator 33 33 +0.0% 1.00x
ArrayAppendFromGeneric 563 564 +0.2% 1.00x(?)
MapReduce 350 351 +0.3% 1.00x(?)
MapReduceShort 2025 2019 -0.3% 1.00x(?)
ObjectiveCBridgeStubDateMutation 257 257 +0.0% 1.00x
IterateData 2531 2530 -0.0% 1.00x(?)
DictionaryLiteral 1386 1386 +0.0% 1.00x
Hanoi 3266 3265 -0.0% 1.00x(?)
ArrayOfGenericPOD 207 207 +0.0% 1.00x
DictionaryRemoveOfObjects 21104 21113 +0.0% 1.00x(?)
ObjectiveCBridgeStubURLAppendPath 199326 198435 -0.5% 1.00x(?)
SortStringsUnicode 7239 7240 +0.0% 1.00x(?)
MapReduceLazySequence 44 44 +0.0% 1.00x
173 8623636 8610744 -0.1% 1.00x
SetIsSubsetOf 275 275 +0.0% 1.00x
NopDeinit 20182 20189 +0.0% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObject 22164 22087 -0.3% 1.00x(?)
SetIntersect 308 308 +0.0% 1.00x
ObjectiveCBridgeStubDataAppend 3495 3482 -0.4% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 74926 74908 -0.0% 1.00x(?)
ArrayInClass 58 58 +0.0% 1.00x
ArrayOfGenericRef 3780 3793 +0.3% 1.00x(?)
StringHasSuffix 781 781 +0.0% 1.00x
Phonebook 7049 7026 -0.3% 1.00x(?)
PolymorphicCalls 20 20 +0.0% 1.00x
Sim2DArray 260 260 +0.0% 1.00x
ArrayAppendRepeatCol 791 791 +0.0% 1.00x
MapReduceShortString 19 19 +0.0% 1.00x
ArrayAppendAscii 18813 18785 -0.1% 1.00x(?)
MonteCarloE 10016 10025 +0.1% 1.00x(?)
StringHasSuffixUnicode 58023 58163 +0.2% 1.00x(?)
ArrayAppendToGeneric 563 563 +0.0% 1.00x
HashTest 1697 1705 +0.5% 1.00x(?)
SetIsSubsetOf_OfObjects 341 341 +0.0% 1.00x
HashQuadratic 5954418 5961371 +0.1% 1.00x(?)
ArrayAppend 930 930 +0.0% 1.00x
DictionaryRemove 2940 2944 +0.1% 1.00x(?)
LinkedList 6738 6736 -0.0% 1.00x(?)
MapReduceAnyCollection 353 353 +0.0% 1.00x
RGBHistogramOfObjects 22648 22598 -0.2% 1.00x(?)
NSStringConversion 681 684 +0.4% 1.00x(?)
MapReduceLazyCollection 84 84 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObjectForced 3932 3928 -0.1% 1.00x(?)
ArrayAppendSequence 925 925 +0.0% 1.00x
ArrayAppendArrayOfInt 564 564 +0.0% 1.00x
ArrayOfPOD 156 156 +0.0% 1.00x
Chars 1439 1438 -0.1% 1.00x(?)
RGBHistogram 2467 2475 +0.3% 1.00x(?)
ObjectiveCBridgeStubFromNSDateRef 3576 3567 -0.2% 1.00x(?)
ObserverForwarderStruct 1023 1022 -0.1% 1.00x(?)
DeadArray 171 171 +0.0% 1.00x
BitCount 1 1 +0.0% 1.00x
AngryPhonebook 2753 2766 +0.5% 1.00x(?)
ArrayPlusEqualArrayOfInt 564 564 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 67615 67514 -0.1% 1.00x(?)
ObjectiveCBridgeStubFromArrayOfNSString 49683 49703 +0.0% 1.00x(?)
MapReduceClass 2945 2957 +0.4% 1.00x(?)
ObjectiveCBridgeFromNSString 1316 1322 +0.5% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 221 221 +0.0% 1.00x
Dictionary2OfObjects 3472 3466 -0.2% 1.00x(?)
ArrayAppendReserved 698 698 +0.0% 1.00x
TwoSum 1181 1186 +0.4% 1.00x(?)
ObjectiveCBridgeStubDateAccess 171 171 +0.0% 1.00x
ObjectiveCBridgeStubNSDataAppend 2146 2149 +0.1% 1.00x(?)
SevenBoom 1383 1381 -0.1% 1.00x(?)
ObjectiveCBridgeStubFromNSDate 3456 3449 -0.2% 1.00x(?)
DictionarySwapOfObjects 6522 6581 +0.9% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 132212 133135 +0.7% 0.99x(?)
Histogram 227 229 +0.9% 0.99x(?)
DictionaryBridge 2784 2806 +0.8% 0.99x(?)
StrComplexWalk 2736 2776 +1.5% 0.99x(?)
ErrorHandling 2839 2860 +0.7% 0.99x(?)
StringHasPrefix 689 694 +0.7% 0.99x(?)
ObjectiveCBridgeStubURLAppendPathRef 200481 201731 +0.6% 0.99x(?)
MapReduceAnyCollectionShort 2235 2262 +1.2% 0.99x(?)
Dictionary 757 767 +1.3% 0.99x(?)
ObjectiveCBridgeStubToArrayOfNSString 26123 26324 +0.8% 0.99x(?)
MapReduceClassShort 4528 4574 +1.0% 0.99x
NSDictionaryCastToSwift 4956 4982 +0.5% 0.99x(?)
SetExclusiveOr 2376 2388 +0.5% 0.99x(?)
ReversedBidirectional 47093 47411 +0.7% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 66234 66788 +0.8% 0.99x(?)
SetUnion 1967 1984 +0.9% 0.99x(?)
RecursiveOwnedParameter 2187 2226 +1.8% 0.98x
ReversedArray 46 47 +2.2% 0.98x(?)
ObjectiveCBridgeStubToNSDate 13669 13930 +1.9% 0.98x(?)
UTF8Decode 258 264 +2.3% 0.98x
StrToInt 5599 5693 +1.7% 0.98x(?)
StringHasPrefixUnicode 13612 13912 +2.2% 0.98x(?)
ObjectAllocation 169 174 +3.0% 0.97x(?)
**Unoptimized (Onone)**
Regression (2)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
HashQuadratic 45079246 49357862 +9.5% 0.91x
173 51268703 55517520 +8.3% 0.92x
Improvement (0)
No Changes (172)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
OpenClose 401 383 -4.5% 1.05x(?)
ObjectiveCBridgeStubToNSDate 14298 13684 -4.3% 1.04x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 141892 137255 -3.3% 1.03x(?)
TypeFlood 162 158 -2.5% 1.03x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 6837 6641 -2.9% 1.03x(?)
ObjectiveCBridgeStubToArrayOfNSString 26457 25861 -2.2% 1.02x(?)
ObjectiveCBridgeStubNSDateMutationRef 14373 14080 -2.0% 1.02x(?)
StackPromo 96816 96230 -0.6% 1.01x(?)
ArrayAppendRepeatCol 195340 194024 -0.7% 1.01x(?)
Histogram 8243 8195 -0.6% 1.01x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7179 7081 -1.4% 1.01x(?)
ArrayAppendGenericStructs 1202 1196 -0.5% 1.01x
ObjectiveCBridgeStubURLAppendPathRef 204842 203650 -0.6% 1.01x(?)
ObjectiveCBridgeToNSSet 35311 34836 -1.4% 1.01x(?)
ObjectiveCBridgeToNSArray 26693 26415 -1.0% 1.01x(?)
NSError 711 704 -1.0% 1.01x(?)
StringEqualPointerComparison 9070 8978 -1.0% 1.01x
CaptureProp 95549 94625 -1.0% 1.01x
MapReduceShortString 223 221 -0.9% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 71360 70372 -1.4% 1.01x(?)
ArraySubscript 3968 3965 -0.1% 1.00x(?)
ObjectiveCBridgeToNSString 1230 1230 +0.0% 1.00x
DictionarySwapOfObjects 18602 18624 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 114520 114281 -0.2% 1.00x(?)
RecursiveOwnedParameter 8857 8856 -0.0% 1.00x(?)
ObjectiveCBridgeStubToNSString 1455 1454 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 42123 42265 +0.3% 1.00x(?)
ClassArrayGetter 902 904 +0.2% 1.00x
Array2D 574384 574502 +0.0% 1.00x(?)
ObjectiveCBridgeStubFromNSDateRef 3838 3837 -0.0% 1.00x(?)
MonteCarloPi 50465 50454 -0.0% 1.00x(?)
StringWithCString 323995 323970 -0.0% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 7320 7307 -0.2% 1.00x(?)
ObjectiveCBridgeFromNSStringForced 2530 2530 +0.0% 1.00x
Prims 8416 8431 +0.2% 1.00x(?)
SortLettersInPlace 2588 2595 +0.3% 1.00x(?)
DictionarySwap 4999 5024 +0.5% 1.00x(?)
ReversedDictionary 23171 23171 +0.0% 1.00x
ArrayAppendToFromGeneric 620 620 +0.0% 1.00x
MapReduceString 2109 2109 +0.0% 1.00x
PopFrontArray 10224 10261 +0.4% 1.00x(?)
Dictionary3OfObjects 2057 2064 +0.3% 1.00x(?)
MapReduceLazyCollectionShort 40496 40438 -0.1% 1.00x(?)
StringHasPrefix 1515 1516 +0.1% 1.00x(?)
ByteSwap 9 9 +0.0% 1.00x
SuperChars 255219 255399 +0.1% 1.00x(?)
ArrayAppendLazyMap 214023 214562 +0.2% 1.00x
XorLoop 21254 21257 +0.0% 1.00x(?)
ArrayAppendReserved 3106 3106 +0.0% 1.00x
StringInterpolation 14078 14094 +0.1% 1.00x(?)
ObserverClosure 6300 6316 +0.2% 1.00x(?)
AnyHashableWithAClass 80583 80329 -0.3% 1.00x
CharacterLiteralsSmall 969 969 +0.0% 1.00x
Integrate 373 373 +0.0% 1.00x
ArrayAppendStrings 12893 12832 -0.5% 1.00x(?)
ObjectiveCBridgeStubFromNSStringRef 202 202 +0.0% 1.00x
ObjectiveCBridgeStubFromNSString 907 910 +0.3% 1.00x(?)
StaticArray 4305 4296 -0.2% 1.00x(?)
ProtocolDispatch 6005 6006 +0.0% 1.00x(?)
ObjectAllocation 615 613 -0.3% 1.00x(?)
SortSortedStrings 1330 1334 +0.3% 1.00x
ProtocolDispatch2 400 400 +0.0% 1.00x
CharacterLiteralsLarge 13179 13131 -0.4% 1.00x(?)
Walsh 11340 11329 -0.1% 1.00x(?)
Dictionary3 1292 1296 +0.3% 1.00x(?)
Dictionary2 3575 3573 -0.1% 1.00x(?)
StrComplexWalk 8005 8011 +0.1% 1.00x(?)
SetIntersect_OfObjects 10506 10502 -0.0% 1.00x(?)
Join 1247 1246 -0.1% 1.00x(?)
ArrayOfRef 8135 8135 +0.0% 1.00x
ObserverUnappliedMethod 7950 7958 +0.1% 1.00x(?)
ArrayAppendOptionals 1195 1195 +0.0% 1.00x
DictionaryOfObjects 4531 4533 +0.0% 1.00x(?)
ObjectiveCBridgeStubToNSDateRef 3214 3230 +0.5% 1.00x(?)
PopFrontArrayGeneric 7641 7678 +0.5% 1.00x
PopFrontUnsafePointer 151458 151455 -0.0% 1.00x(?)
MapReduceAnyCollectionShort 44614 44625 +0.0% 1.00x(?)
RC4 6876 6873 -0.0% 1.00x(?)
ObjectiveCBridgeStubToNSStringRef 139 139 +0.0% 1.00x
Calculator 967 966 -0.1% 1.00x(?)
ArrayAppendFromGeneric 622 621 -0.2% 1.00x(?)
MapReduce 34353 34248 -0.3% 1.00x
MapReduceSequence 39457 39496 +0.1% 1.00x
MapReduceShort 44781 44655 -0.3% 1.00x(?)
IterateData 10494 10511 +0.2% 1.00x
DictionaryLiteral 12080 12035 -0.4% 1.00x(?)
Hanoi 15604 15612 +0.1% 1.00x(?)
DictionaryRemoveOfObjects 50094 50175 +0.2% 1.00x(?)
UTF8Decode 35055 35037 -0.1% 1.00x
ObjectiveCBridgeStubURLAppendPath 203784 204017 +0.1% 1.00x(?)
SortStringsUnicode 8500 8499 -0.0% 1.00x(?)
MapReduceLazySequence 25803 25770 -0.1% 1.00x(?)
SetExclusiveOr 19492 19527 +0.2% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 93949 94351 +0.4% 1.00x(?)
SetIsSubsetOf 1535 1539 +0.3% 1.00x(?)
Dictionary 1693 1694 +0.1% 1.00x(?)
SetIntersect 9874 9920 +0.5% 1.00x(?)
ObjectiveCBridgeStubDataAppend 3553 3566 +0.4% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 80159 79774 -0.5% 1.00x(?)
ObjectiveCBridgeStubNSDateRefAccess 1122 1125 +0.3% 1.00x(?)
ArrayInClass 4235 4234 -0.0% 1.00x(?)
ArrayOfGenericRef 9083 9086 +0.0% 1.00x(?)
StringHasSuffix 1643 1638 -0.3% 1.00x(?)
PolymorphicCalls 721 721 +0.0% 1.00x
Sim2DArray 28801 28797 -0.0% 1.00x(?)
SetExclusiveOr_OfObjects 38748 38696 -0.1% 1.00x(?)
ObjectiveCBridgeStubDateMutation 486 486 +0.0% 1.00x
ObjectiveCBridgeToNSDictionary 56806 57026 +0.4% 1.00x(?)
MonteCarloE 78374 78747 +0.5% 1.00x
SetUnion_OfObjects 27994 27990 -0.0% 1.00x(?)
StringHasSuffixUnicode 59378 59331 -0.1% 1.00x(?)
ArrayAppendToGeneric 623 623 +0.0% 1.00x
HashTest 5538 5533 -0.1% 1.00x(?)
SetIsSubsetOf_OfObjects 1511 1508 -0.2% 1.00x
ArrayAppend 3569 3568 -0.0% 1.00x(?)
DictionaryRemove 17592 17632 +0.2% 1.00x(?)
StringHasPrefixUnicode 15074 15067 -0.1% 1.00x(?)
LinkedList 31438 31444 +0.0% 1.00x(?)
MapReduceAnyCollection 34379 34289 -0.3% 1.00x
RGBHistogramOfObjects 84722 84588 -0.2% 1.00x(?)
MapReduceLazyCollection 30806 30894 +0.3% 1.00x
ArrayAppendSequence 68423 68557 +0.2% 1.00x
ArrayAppendArrayOfInt 618 617 -0.2% 1.00x
ArrayOfPOD 1785 1785 +0.0% 1.00x
Chars 6948 6959 +0.2% 1.00x(?)
RGBHistogram 30376 30331 -0.1% 1.00x(?)
ReversedArray 464 464 +0.0% 1.00x
StringBuilder 2747 2744 -0.1% 1.00x(?)
ObserverForwarderStruct 4378 4383 +0.1% 1.00x(?)
DeadArray 121103 121288 +0.1% 1.00x(?)
ObjectiveCBridgeStubNSDataAppend 2446 2449 +0.1% 1.00x(?)
BitCount 97 97 +0.0% 1.00x
AngryPhonebook 2920 2920 +0.0% 1.00x
ArrayPlusEqualArrayOfInt 619 619 +0.0% 1.00x
SevenBoom 1523 1524 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 68640 68419 -0.3% 1.00x(?)
StringWalk 20129 20143 +0.1% 1.00x(?)
ArrayValueProp 3229 3218 -0.3% 1.00x(?)
ObjectiveCBridgeStubFromArrayOfNSString 50160 50161 +0.0% 1.00x(?)
MapReduceClass 39411 39436 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSString 3762 3766 +0.1% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 41622 41620 -0.0% 1.00x(?)
Dictionary2OfObjects 5832 5844 +0.2% 1.00x(?)
ArrayValueProp4 3483 3475 -0.2% 1.00x(?)
TwoSum 4376 4392 +0.4% 1.00x(?)
ObjectiveCBridgeStubDateAccess 943 943 +0.0% 1.00x
ArrayValueProp2 3796 3799 +0.1% 1.00x(?)
ArrayValueProp3 3590 3584 -0.2% 1.00x(?)
ObjectiveCBridgeStubFromNSDate 3830 3834 +0.1% 1.00x(?)
ObserverPartiallyAppliedMethod 7646 7648 +0.0% 1.00x(?)
SortStrings 2534 2553 +0.8% 0.99x
DictionaryBridge 2933 2953 +0.7% 0.99x(?)
ArrayAppendLatin1 95922 97049 +1.2% 0.99x
RangeAssignment 5300 5334 +0.6% 0.99x
ArrayPlusEqualFiveElementCollection 259832 261380 +0.6% 0.99x(?)
ArrayPlusEqualSingleElementCollection 256391 260192 +1.5% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObject 62939 63828 +1.4% 0.99x(?)
ArrayLiteral 1564 1574 +0.6% 0.99x(?)
ArrayAppendUTF16 95492 96053 +0.6% 0.99x
StrToInt 6855 6953 +1.4% 0.99x
Phonebook 19930 20122 +1.0% 0.99x
ArrayAppendAscii 76630 77330 +0.9% 0.99x
NSStringConversion 1175 1183 +0.7% 0.99x(?)
SetUnion 10923 11069 +1.3% 0.99x
ErrorHandling 3778 3843 +1.7% 0.98x(?)
ObjectiveCBridgeFromNSArrayAnyObject 23951 24469 +2.2% 0.98x(?)
NSDictionaryCastToSwift 6112 6246 +2.2% 0.98x(?)
ReversedBidirectional 132096 134911 +2.1% 0.98x(?)
NopDeinit 43827 45145 +3.0% 0.97x(?)
MapReduceClassShort 48756 50394 +3.4% 0.97x(?)
ArrayOfGenericPOD 2893 3044 +5.2% 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

@ben-ng
Copy link
Author

ben-ng commented Mar 5, 2017

Oops, it looks like I moved the pass too early. I'll have to look into why the test didn't catch that...

@eeckstein
Copy link
Contributor

@ben-ng I'd like to get your change in. If you don't mind I'll create another pull request containing your patch plus some fixes.
Thanks a lot for your work!

@ben-ng
Copy link
Author

ben-ng commented Mar 23, 2017

Hey @eeckstein, I don't mind at all. I haven't been able to figure out how to get this optimization to work without blocking other optimization passes. The problem is that it adds a semantic attribute to functions that themselves contain calls to functions with semantic attributes, and that stops some calls from being inlined where they were before.

I tried moving the pass earlier, but that caused one of the specialization tests to fail. I haven't had time to continue debugging the problem since then.

@eeckstein
Copy link
Contributor

@ben-ng Great, thanks! I think your approach is basically fine. It just needs some minor tweaks.

@ben-ng
Copy link
Author

ben-ng commented Apr 3, 2017

Merged in #8464

@ben-ng ben-ng closed this Apr 3, 2017
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.

7 participants