Skip to content

[Stdlib] Improves Collection.sort to accept throwing closure #1527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 12, 2017

Conversation

codestergit
Copy link
Contributor

What's in this pull request?

This pull request improves MutableCollectionType.sort ,MutableCollectionType.sortInPlace and other sort related functions to take throwing clousre.

Resolved bug number: (SR-715)


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

This commit resolves https://bugs.swift.org/browse/SR-715

@codestergit
Copy link
Contributor Author

There are two tests which are failing.

  1. test/DebugInfo/closure-multivalue.swift
    I have tried to genereate IR and with my changes it is showing linkageName: _TPA__TTRXFo_oSSoSS_dSb_XFo_iSSiSS_dSb_ previously it was ``linkageName: TTRXFo_oSSoSS_dSb_XFo_iSSiSS_dSb`. So I have changed but it did not pass the testCase.
    Here:
    https://github.com/apple/swift/pull/1527/files#diff-fe533918e3617168eef57e89f39cfe2fL37
    Please let me know how to resolve this and what I am missing.

  2. test/SourceKit/SourceDocInfo/cursor_stdlib.swift
    I have tried to fix this but it is failing.

I need help to fix these test cases.
Thanks

@gribozavr
Copy link
Contributor

@codestergit Thank you! Two requests from me.

  1. Please add documentation about the behavior of this method when an error is thrown. (It actually has mutated the collection, but only reordered the elements. No elements are lost, no new elements are introduced.)
  2. The tests you are added are a good start, but we can improve. Please take a look at existing tests here stdlib/private/StdlibCollectionUnittest/CheckMutableCollectionType.swift.gyb and try to come up with a few cases that sort a collection and the comparator throws an error in the middle of the operation. Then check that the sorting kept the same set of elements in the collection. Please add new tests to that common file, so that the tests get run for every collection implementation, increasing our coverage.

@phyr0s
Copy link

phyr0s commented Mar 22, 2016

Please Fix conflicts

@codestergit
Copy link
Contributor Author

There are lot of conflicts because of swift 3 changes. I am redoing my changes.I will merge the changes soon by addressing comments :)

@phyr0s
Copy link

phyr0s commented Mar 22, 2016

I'm Happy to hear that!!

2016-03-22 11:27 GMT+01:00 codester [email protected]:

There are lot of conflicts because of swift 3 changes. I am redoing my
changes.I will merge the changes soon by addressing comments :)


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#1527 (comment)

@codestergit codestergit changed the title [Stdlib] Improves CollectionType.sort to accept throwing clousre and… [WIP][Stdlib] Improves CollectionType.sort to accept throwing clousre and… Mar 22, 2016
@codestergit
Copy link
Contributor Author

codestergit commented Apr 21, 2016

First of all I am really sorry for the delay. I got some urgent work and need to go out of station so this got delay.
I have updated the pull request and test are passing but I got one problem. sorted is working as expected. When predicate isOrderedBefore throws in between sorting it will return nothing and source array remains unchanged.
But sort is mutating the collection and if isOrderedBefore throws in between sorting there may be case original source elements may be lost as insertionSort algo not able to complete it's loop and swap so elements may get lost or duplicate. I have commented the same test case in ErrorHandling.swift test .
Here I have given [3, 2, 1] and if isOrderedBefore throws in between the source array gets mutated and changed to [2, 3, 3].
We can not catch the error and mutate the elements to original array back and throw the error again from sort function as it have to rethrows and I do not know it is good idea to save the collection copy.

@gribozavr @dabrahams any suggestions how to handle this or is this required behaviour??
Thanks for your help as always :)

print("collection before error \(collection)")
print("a \(a) \(b)")

if b == 2 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

With this case sort mutates the collection to [2, 3, 3]. insertionSort not able to complete the loop and swap elements so we are loosing the elements from original collection.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I find losing elements surprising though. Wouldn't we want to ensure that we don't lose elements as a matter of QoI for this API specifically?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gribozavr It throws here and swap operation not able to complete. We also do partition of elements if elements are above 20. It may duplicate elements and loose.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. Can we catch the error, store the elements back in arbitrary order, and re-throw?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, and in 99% of cases a partly sorted collection is useless to you and you have no alternative way to do the same sort, so in 99% of cases you’ll be sorting something you’re willing to lose, like a copy of the original collection.

By the way, if you did have a fallback for a failing comparison, you’d just make your comparison fall back to it rather than aborting the sort and starting over again.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's what I was thinking too, and so I couldn't think of why you'd want to have a throwing comparator at all. But I can imagine wanting to have the fallback be consistent: either everything sorts using the "good" comparison, or everything sorts using the fallback.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this is all theoretically possible but highly unlikely and not worth designing for. It’s reasonable to do something as QOI but the precedent set by documenting the behavior would significantly complicate what people need to do to reason about (and document their own) error handling.

Copy link
Contributor

Choose a reason for hiding this comment

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

If it's not worth designing for, I'm not sure why it's worth implementing. If it's there, someone will start depending on it.

Copy link
Contributor

Choose a reason for hiding this comment

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

on Fri Apr 22 2016, Jordan Rose <notifications-AT-i.8713187.xyz> wrote:

In test/1_stdlib/ErrorHandling.swift:

@@ -340,4 +340,42 @@ ErrorHandlingTests.test("ErrorHandling/Collection map") {
}
}

+/* when b == 2 we are losing elements. insertion sort throws error
+in between while sorting so loop is not able to complete and swap the elements and array mutates
+to [2,3,3]
+ErrorHandlingTests.test("ErrorHandling/sort") {

  • var collection = [3, 2, 1]
  • do {
  • try collection.sort { (a, b) throws -> Bool in
  •  print("collection before error (collection)")
    
  •  print("a (a) (b)")
    
  •  if b == 2 {
    

If it's not worth designing for, I'm not sure why it's worth implementing. If
it's there, someone will start depending on it.

It will prevent one or two naive users from having a subtle bug, it will
prevent us from fielding/rejecting a long stream of bug reports from
people who think they should be able to rely on it, and I don't mind
people relying on it. What I don't want, at least not without
significantly more consideration, is to formalize this as part of how we
describe error handling behavior.

Dave

@dabrahams
Copy link
Contributor

on Thu Apr 21 2016, codester <notifications-AT-i.8713187.xyz> wrote:

First of all I am really sorry for the delay. I got some urgent work and need to
go out of station so this got delay.
I have updated the pull request and test are passing but I got one problem.
sorted is working as expected. When predicate isOrderedBefore throws in between
sorting it will return nothing and source array remains unchanged.
But sort is mutating the collection and if isOrderedBefore throws in between
sorting there may be case original source elements may be lost as insertionSort
algo not able to complete it's loop and swap so elements may get lost or
duplicate.

There's nothing wrong with that. The only requirement of an operation
that throws, unless we explicitly add stronger requirements, is that it
doesn't break any locally-known invariants. This is called the “basic
guarantee.” https://en.wikipedia.org/wiki/Exception_safety

Dave

@codestergit
Copy link
Contributor Author

@dabrahams @gribozavr Updated the pull request. Please review it.

I have caught the error here and thrown it again. I have tried to test this thoroughly and it passed the tests. We do partition and sort with greater than 20 elements.. So checking all permutations with more than 20 elements was not feasible so I changed the algorithm locally and tried to do partition and sort with all permutations of 5 element sequence and it passed all the tests.
Please let me know if any changes required.
Thanks!

@CodaFi
Copy link
Contributor

CodaFi commented Jan 13, 2017

@codestergit I'm sorry that this fell by the wayside. If you can rebase and fix the merge conflicts could you please do so. Else I can take over this PR.

@codestergit
Copy link
Contributor Author

codestergit commented Jan 17, 2017

@CodaFi Thanks, I will rebase and update the pull request soon.

@codestergit codestergit force-pushed the master branch 3 times, most recently from b2ef055 to e86fb6e Compare January 29, 2017 17:58
@codestergit
Copy link
Contributor Author

codestergit commented Jan 29, 2017

@CodaFi @gribozavr
Updated the pull request. Please review the pull request.
I reworked on this pull request from starting because of lot of changes. That's why it took little bit time.
Please let me know if any changes required.
Thanks

@codestergit codestergit changed the title [WIP][Stdlib] Improves CollectionType.sort to accept throwing clousre and… [Stdlib] Improves CollectionType.sort to accept throwing clousre and… Jan 29, 2017
@@ -269,6 +269,9 @@ extension ${Self} {
/// Returns the elements of the ${sequenceKind}, sorted using the given
/// predicate as the comparison between elements.
///
/// This method can take throwing closure. If closure throws error while
/// sorting, it will return empty collection.
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like the wrong behavior. Why isn't the error simply propagated outward (in which case nothing is actually returned)?

Copy link
Contributor Author

@codestergit codestergit Jan 29, 2017

Choose a reason for hiding this comment

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

Sorry I made mistake(wrongly documented) here. It will throw error. I will correct it.
Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dabrahams Removed comment. Thanks.
Please let me know if any other changes required.

break
}
} catch {
elements[i] = x
Copy link
Contributor

Choose a reason for hiding this comment

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

Why bother doing the above? Isn't elements about to be discarded?

Copy link
Contributor Author

@codestergit codestergit Jan 29, 2017

Choose a reason for hiding this comment

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

No, If we are mutating a collection with sort(by:) than collection has been changed and at this line we are trying to swap the elements.
For eg: if I have array
var a = [ 5, 4, 3 ,2, 1]
if we throw at b == 4 than sort(by:) mutate the collection to
[4, 5, 5, 2, 1] //3 is lost here
as the last step

   if i != sortedEnd {
         // Plop x into position	
         elements[i] = x
       }		       

not able to swap the element and we thrown the error in between. So that is why this step is required and we are catching the error and throwing it again.
It just take care of no elements will lost and add. Elements of a may reorder .

@dabrahams
Copy link
Contributor

dabrahams commented Jan 29, 2017 via email

@codestergit
Copy link
Contributor Author

codestergit commented Jan 29, 2017

but keep in mind that
in general it's not something we can guarantee for mutating algorithms
that rethrow.

@dabrahams Yes, I agree with you. Previously @gribozavr suggested that we should try to handle this. If you would like I can remove this documentation .

No elements will be lost.

@airspeedswift airspeedswift changed the title [Stdlib] Improves CollectionType.sort to accept throwing clousre and… [Stdlib] Improves Collection.sort to accept throwing closure Jan 29, 2017
@airspeedswift
Copy link
Member

This PR conflicts with @natecook1000’s one (#6638) to de-gyb sorts. Does it make sense to combine them or should one go before the other?

@airspeedswift
Copy link
Member

@swift-ci Please test

@swift-ci
Copy link
Contributor

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

@swift-ci
Copy link
Contributor

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

@codestergit
Copy link
Contributor Author

codestergit commented Jan 29, 2017

@airspeedswift Thanks for running tests. Why error by build bot. Is something wrong ?

Wrong sha e86fb6e14bbf463f6b591042e52e6c50e6130392

@natecook1000 @airspeedswift @dabrahams I think we should merge them separately. We can work one above another. It got conflict three times previously 😢. I hope it will merge this time 😁 😊 😄.
Please let me know if any changes required.
Thanks :)

@airspeedswift
Copy link
Member

If we do end up getting to the point where we need to debug generated code for performance, this makes it more worthwhile to combine this + the de-gybbed PR, since it also had unexpected performance implications.

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (10)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
RGBHistogram 2115 3594 +69.9% 0.59x
SortSortedStrings 748 1142 +52.7% 0.65x
ObjectiveCBridgeStubFromNSStringRef 164 236 +43.9% 0.69x
SortStrings 1527 2032 +33.1% 0.75x
SortLettersInPlace 997 1209 +21.3% 0.82x
Calculator 28 31 +10.7% 0.90x
SortStringsUnicode 6921 7693 +11.2% 0.90x
RGBHistogramOfObjects 20892 23091 +10.5% 0.90x
OpenClose 51 54 +5.9% 0.94x
Phonebook 6569 6988 +6.4% 0.94x
Improvement (2)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StringHasPrefix 657 572 -12.9% 1.15x
StringHasSuffix 753 641 -14.9% 1.17x
No Changes (157)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
NSStringConversion 702 668 -4.8% 1.05x
ObjectiveCBridgeStubToArrayOfNSString 29885 28804 -3.6% 1.04x(?)
RangeAssignment 277 268 -3.2% 1.03x
ObjectiveCBridgeStubFromNSDate 3412 3320 -2.7% 1.03x
AnyHashableWithAClass 61797 60786 -1.6% 1.02x
Walsh 305 300 -1.6% 1.02x
ObjectiveCBridgeToNSSet 35681 35079 -1.7% 1.02x(?)
UTF8Decode 269 265 -1.5% 1.02x
ObjectiveCBridgeStubURLAppendPath 210591 206937 -1.7% 1.02x(?)
ObjectiveCBridgeStubDataAppend 3303 3253 -1.5% 1.02x(?)
ObjectiveCBridgeStubNSDateMutationRef 11818 11615 -1.7% 1.02x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 80773 80363 -0.5% 1.01x(?)
Array2D 1834 1816 -1.0% 1.01x(?)
ReversedDictionary 80 79 -1.2% 1.01x(?)
SuperChars 203402 200442 -1.5% 1.01x(?)
StringInterpolation 9093 8988 -1.1% 1.01x(?)
ObjectiveCBridgeStubToNSString 1405 1398 -0.5% 1.01x(?)
CharacterLiteralsLarge 11640 11549 -0.8% 1.01x(?)
ObjectiveCBridgeStubToNSDateRef 3189 3150 -1.2% 1.01x(?)
SetExclusiveOr 2716 2684 -1.2% 1.01x
NopDeinit 21264 20999 -1.2% 1.01x(?)
StringHasPrefixUnicode 12994 12861 -1.0% 1.01x(?)
ObserverForwarderStruct 846 840 -0.7% 1.01x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 74713 74172 -0.7% 1.01x(?)
ObjectiveCBridgeStubFromArrayOfNSString 56482 55809 -1.2% 1.01x(?)
ArraySubscript 1351 1353 +0.1% 1.00x(?)
ObjectiveCBridgeToNSString 1204 1203 -0.1% 1.00x(?)
DictionarySwapOfObjects 6709 6720 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 137858 137929 +0.1% 1.00x(?)
RecursiveOwnedParameter 1823 1819 -0.2% 1.00x(?)
Integrate 224 224 +0.0% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 147363 147643 +0.2% 1.00x(?)
ClassArrayGetter 12 12 +0.0% 1.00x
Histogram 270 270 +0.0% 1.00x
DictionaryBridge 2849 2853 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 4991 5006 +0.3% 1.00x(?)
MonteCarloPi 42525 42515 -0.0% 1.00x(?)
StringWithCString 145928 145899 -0.0% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 5665 5678 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSStringForced 2176 2174 -0.1% 1.00x(?)
DictionarySwap 388 388 +0.0% 1.00x
ArrayAppendToFromGeneric 563 563 +0.0% 1.00x
MapReduceString 70 70 +0.0% 1.00x
PopFrontArray 1056 1055 -0.1% 1.00x(?)
Dictionary3OfObjects 870 866 -0.5% 1.00x(?)
MapReduceLazyCollectionShort 57 57 +0.0% 1.00x
ByteSwap 0 0 +0.0% 1.00x
ArrayAppendGenericStructs 1136 1136 +0.0% 1.00x
ArrayAppendLazyMap 863 864 +0.1% 1.00x(?)
ArrayPlusEqualFiveElementCollection 55601 55581 -0.0% 1.00x(?)
XorLoop 332 332 +0.0% 1.00x
ArrayAppendReserved 698 698 +0.0% 1.00x
CharacterLiteralsSmall 767 767 +0.0% 1.00x
ArrayPlusEqualSingleElementCollection 53226 53320 +0.2% 1.00x(?)
ArrayAppendStrings 11330 11323 -0.1% 1.00x(?)
Join 452 451 -0.2% 1.00x(?)
ObjectiveCBridgeStubFromNSString 841 842 +0.1% 1.00x(?)
ProtocolDispatch 2859 2859 +0.0% 1.00x
ObjectAllocation 164 164 +0.0% 1.00x
TypeFlood 0 0 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObject 65965 66061 +0.1% 1.00x(?)
ProtocolDispatch2 149 149 +0.0% 1.00x
Dictionary3 500 501 +0.2% 1.00x(?)
Dictionary2 1969 1976 +0.4% 1.00x(?)
StrComplexWalk 2808 2801 -0.2% 1.00x(?)
SetIntersect_OfObjects 1364 1367 +0.2% 1.00x(?)
ErrorHandling 2924 2928 +0.1% 1.00x(?)
ArrayOfRef 3639 3642 +0.1% 1.00x(?)
ObjectiveCBridgeStubURLAppendPathRef 212468 211897 -0.3% 1.00x(?)
ArrayPlusEqualArrayOfInt 563 563 +0.0% 1.00x
ObjectiveCBridgeToNSArray 29997 29972 -0.1% 1.00x(?)
NSError 330 329 -0.3% 1.00x(?)
DictionaryOfObjects 2328 2330 +0.1% 1.00x(?)
PopFrontArrayGeneric 1062 1066 +0.4% 1.00x(?)
PopFrontUnsafePointer 8576 8580 +0.1% 1.00x(?)
StringEqualPointerComparison 6908 6902 -0.1% 1.00x(?)
CaptureProp 4293 4292 -0.0% 1.00x(?)
PolymorphicCalls 20 20 +0.0% 1.00x
RC4 148 148 +0.0% 1.00x
ObjectiveCBridgeStubToNSStringRef 104 104 +0.0% 1.00x
ArrayAppendFromGeneric 563 563 +0.0% 1.00x
MapReduce 321 321 +0.0% 1.00x
MapReduceShort 1965 1958 -0.4% 1.00x(?)
ObjectiveCBridgeStubDateMutation 257 257 +0.0% 1.00x
IterateData 2462 2452 -0.4% 1.00x
DictionaryLiteral 1385 1382 -0.2% 1.00x(?)
ArrayOfGenericPOD 207 207 +0.0% 1.00x
DictionaryRemoveOfObjects 20173 20161 -0.1% 1.00x(?)
MapReduceLazySequence 44 44 +0.0% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 89764 89863 +0.1% 1.00x(?)
SetIsSubsetOf 228 228 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObject 62672 62392 -0.5% 1.00x(?)
MapReduceClassShort 4550 4545 -0.1% 1.00x(?)
NSDictionaryCastToSwift 4972 4983 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 92901 93322 +0.5% 1.00x(?)
ArrayAppendOptionals 1136 1136 +0.0% 1.00x
ArrayOfGenericRef 3767 3774 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSString 1302 1299 -0.2% 1.00x(?)
ObjectiveCBridgeStubDateAccess 171 171 +0.0% 1.00x
SetExclusiveOr_OfObjects 6977 6993 +0.2% 1.00x(?)
ArrayAppendRepeatCol 713 713 +0.0% 1.00x
MapReduceShortString 18 18 +0.0% 1.00x
ObjectiveCBridgeToNSDictionary 57781 57680 -0.2% 1.00x(?)
MonteCarloE 9826 9825 -0.0% 1.00x(?)
SetUnion_OfObjects 5831 5818 -0.2% 1.00x(?)
ReversedBidirectional 46240 46467 +0.5% 1.00x(?)
StringHasSuffixUnicode 57195 57215 +0.0% 1.00x(?)
ArrayAppendToGeneric 563 563 +0.0% 1.00x
HashTest 1716 1715 -0.1% 1.00x(?)
SetIsSubsetOf_OfObjects 291 291 +0.0% 1.00x
ArrayAppend 927 927 +0.0% 1.00x
DictionaryRemove 2176 2186 +0.5% 1.00x(?)
LinkedList 6826 6826 +0.0% 1.00x
MapReduceAnyCollection 324 324 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 65774 65452 -0.5% 1.00x(?)
MapReduceLazyCollection 84 84 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObjectForced 4064 4066 +0.1% 1.00x(?)
ArrayAppendSequence 938 937 -0.1% 1.00x(?)
ArrayAppendArrayOfInt 562 563 +0.2% 1.00x(?)
SetUnion 2160 2162 +0.1% 1.00x(?)
ObjectiveCBridgeStubFromNSDateRef 3377 3379 +0.1% 1.00x(?)
StringBuilder 1330 1328 -0.1% 1.00x(?)
ObjectiveCBridgeStubNSDateRefAccess 322 323 +0.3% 1.00x(?)
DeadArray 174 174 +0.0% 1.00x
ObjectiveCBridgeStubNSDataAppend 2150 2141 -0.4% 1.00x(?)
BitCount 1 1 +0.0% 1.00x
AngryPhonebook 3052 3051 -0.0% 1.00x(?)
SevenBoom 1390 1385 -0.4% 1.00x(?)
ArrayValueProp 5 5 +0.0% 1.00x
MapReduceClass 2956 2950 -0.2% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 221 221 +0.0% 1.00x
Dictionary2OfObjects 3391 3399 +0.2% 1.00x(?)
ArrayValueProp4 5 5 +0.0% 1.00x
TwoSum 1264 1258 -0.5% 1.00x(?)
ArrayValueProp2 5 5 +0.0% 1.00x
ArrayValueProp3 5 5 +0.0% 1.00x
Sim2DArray 260 261 +0.4% 1.00x(?)
ObserverPartiallyAppliedMethod 3423 3406 -0.5% 1.00x(?)
StackPromo 20438 20656 +1.1% 0.99x
ObserverClosure 1984 1994 +0.5% 0.99x(?)
StaticArray 117 118 +0.8% 0.99x(?)
ArrayLiteral 1297 1304 +0.5% 0.99x(?)
MapReduceSequence 560 563 +0.5% 0.99x(?)
Dictionary 708 716 +1.1% 0.99x
ArrayOfPOD 155 156 +0.7% 0.99x
StringWalk 5619 5658 +0.7% 0.99x
ReversedArray 46 47 +2.2% 0.98x(?)
ObjectiveCBridgeStubToNSDate 13465 13673 +1.5% 0.98x(?)
ArrayInClass 58 59 +1.7% 0.98x(?)
168 2681680 2728675 +1.8% 0.98x
Chars 582 592 +1.7% 0.98x
Prims 700 721 +3.0% 0.97x
ObserverUnappliedMethod 2430 2508 +3.2% 0.97x(?)
SetIntersect 331 340 +2.7% 0.97x(?)
Hanoi 3102 3267 +5.3% 0.95x
StrToInt 4684 4933 +5.3% 0.95x
**Unoptimized (Onone)**
Regression (5)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ArrayOfGenericPOD 2881 3544 +23.0% 0.81x
ObjectiveCBridgeStubDateMutation 429 486 +13.3% 0.88x
ProtocolDispatch 5153 5768 +11.9% 0.89x
TypeFlood 176 189 +7.4% 0.93x(?)
ObjectiveCBridgeStubFromNSDate 3566 3774 +5.8% 0.94x
Improvement (4)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StrComplexWalk 7710 7304 -5.3% 1.06x
ObjectiveCBridgeFromNSSetAnyObjectToString 105567 98782 -6.4% 1.07x(?)
PopFrontUnsafePointer 169635 152833 -9.9% 1.11x
OpenClose 412 372 -9.7% 1.11x(?)
No Changes (160)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StringHasSuffix 1575 1495 -5.1% 1.05x
StringHasPrefix 1515 1462 -3.5% 1.04x
Calculator 928 892 -3.9% 1.04x
ObjectiveCBridgeStubNSDataAppend 2542 2443 -3.9% 1.04x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 95639 92534 -3.2% 1.03x(?)
NSStringConversion 1227 1196 -2.5% 1.03x
ArrayOfPOD 1785 1728 -3.2% 1.03x
StringWalk 22456 21882 -2.6% 1.03x
StackPromo 124074 121336 -2.2% 1.02x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 9303 9111 -2.1% 1.02x(?)
StringInterpolation 13284 13065 -1.6% 1.02x(?)
CharacterLiteralsLarge 12688 12397 -2.3% 1.02x(?)
ObjectiveCBridgeToNSSet 36136 35436 -1.9% 1.02x(?)
NSError 676 661 -2.2% 1.02x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 83178 81818 -1.6% 1.02x(?)
ObjectiveCBridgeStubURLAppendPath 214922 211058 -1.8% 1.02x(?)
StrToInt 5102 4980 -2.4% 1.02x
ObjectiveCBridgeStubFromArrayOfNSString 57001 55894 -1.9% 1.02x(?)
AnyHashableWithAClass 75951 75384 -0.8% 1.01x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 142328 141145 -0.8% 1.01x(?)
ErrorHandling 3832 3794 -1.0% 1.01x(?)
ArrayLiteral 1353 1337 -1.2% 1.01x
Dictionary2 3521 3499 -0.6% 1.01x(?)
ObjectiveCBridgeStubURLAppendPathRef 217218 214268 -1.4% 1.01x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 75759 75222 -0.7% 1.01x(?)
ObjectiveCBridgeToNSArray 30367 30156 -0.7% 1.01x(?)
PopFrontArrayGeneric 8928 8882 -0.5% 1.01x
StringEqualPointerComparison 9116 8985 -1.4% 1.01x(?)
CaptureProp 114956 114296 -0.6% 1.01x
Hanoi 18449 18218 -1.2% 1.01x
ObjectiveCBridgeStubToArrayOfNSString 30076 29864 -0.7% 1.01x(?)
ObjectiveCBridgeStubDataAppend 3437 3392 -1.3% 1.01x(?)
ArrayAppendRepeatCol 205471 203920 -0.8% 1.01x
ObjectiveCBridgeStubNSDateMutationRef 14319 14221 -0.7% 1.01x(?)
ArraySubscript 5305 5315 +0.2% 1.00x(?)
ObjectiveCBridgeToNSString 1228 1227 -0.1% 1.00x(?)
DictionarySwapOfObjects 19379 19316 -0.3% 1.00x(?)
PopFrontArray 12763 12746 -0.1% 1.00x(?)
RecursiveOwnedParameter 10223 10266 +0.4% 1.00x
ObjectiveCBridgeStubToNSString 1465 1461 -0.3% 1.00x
ClassArrayGetter 1200 1200 +0.0% 1.00x
Array2D 765413 766089 +0.1% 1.00x(?)
MonteCarloPi 50240 50269 +0.1% 1.00x
StringWithCString 142410 142339 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSStringForced 2508 2507 -0.0% 1.00x(?)
DictionarySwap 5889 5881 -0.1% 1.00x(?)
ReversedDictionary 29865 29992 +0.4% 1.00x
ArrayAppendToFromGeneric 673 674 +0.1% 1.00x(?)
Dictionary3OfObjects 2053 2057 +0.2% 1.00x(?)
RangeAssignment 6746 6743 -0.0% 1.00x(?)
MapReduceLazyCollectionShort 45644 45529 -0.2% 1.00x(?)
ByteSwap 9 9 +0.0% 1.00x
ArrayAppendGenericStructs 1252 1252 +0.0% 1.00x
SuperChars 255089 254774 -0.1% 1.00x(?)
ArrayAppendLazyMap 259035 259110 +0.0% 1.00x(?)
ArrayPlusEqualFiveElementCollection 520437 519425 -0.2% 1.00x(?)
ObjectiveCBridgeStubToNSDate 13856 13923 +0.5% 1.00x(?)
XorLoop 18818 18813 -0.0% 1.00x(?)
ArrayAppendReserved 3108 3105 -0.1% 1.00x(?)
ObserverClosure 6822 6802 -0.3% 1.00x(?)
CharacterLiteralsSmall 916 917 +0.1% 1.00x
ArrayPlusEqualSingleElementCollection 508184 508602 +0.1% 1.00x(?)
ArrayAppendStrings 11160 11146 -0.1% 1.00x(?)
ObjectiveCBridgeStubFromNSString 880 882 +0.2% 1.00x(?)
StaticArray 3482 3478 -0.1% 1.00x(?)
ObjectAllocation 573 574 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObject 68615 68712 +0.1% 1.00x(?)
ProtocolDispatch2 417 415 -0.5% 1.00x
Dictionary3 1325 1325 +0.0% 1.00x
SetIntersect_OfObjects 11168 11161 -0.1% 1.00x(?)
Join 1382 1379 -0.2% 1.00x(?)
ArrayOfRef 8686 8658 -0.3% 1.00x(?)
ObserverUnappliedMethod 8416 8445 +0.3% 1.00x(?)
ArrayPlusEqualArrayOfInt 672 672 +0.0% 1.00x
DictionaryOfObjects 4458 4449 -0.2% 1.00x(?)
ObjectiveCBridgeStubToNSDateRef 3192 3197 +0.2% 1.00x(?)
PolymorphicCalls 647 647 +0.0% 1.00x
RC4 8948 8926 -0.2% 1.00x(?)
ObjectiveCBridgeStubToNSStringRef 139 139 +0.0% 1.00x
ArrayAppendFromGeneric 674 675 +0.1% 1.00x(?)
MapReduce 42345 42383 +0.1% 1.00x(?)
MapReduceSequence 45997 45990 -0.0% 1.00x(?)
MapReduceShort 53920 53913 -0.0% 1.00x(?)
IterateData 10120 10149 +0.3% 1.00x(?)
DictionaryLiteral 15283 15309 +0.2% 1.00x(?)
DictionaryRemoveOfObjects 47045 46979 -0.1% 1.00x(?)
MapReduceLazySequence 28101 28046 -0.2% 1.00x(?)
SetIsSubsetOf 1947 1955 +0.4% 1.00x
Dictionary 1778 1778 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObject 64560 64383 -0.3% 1.00x(?)
SetIntersect 11727 11729 +0.0% 1.00x(?)
MapReduceClassShort 57676 57554 -0.2% 1.00x(?)
ArrayAppendOptionals 1255 1252 -0.2% 1.00x(?)
StringBuilder 2749 2760 +0.4% 1.00x(?)
ArrayInClass 3735 3732 -0.1% 1.00x(?)
ArrayOfGenericRef 9601 9621 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSString 3905 3892 -0.3% 1.00x(?)
Sim2DArray 13699 13706 +0.1% 1.00x
SetExclusiveOr_OfObjects 37227 37139 -0.2% 1.00x
MapReduceShortString 264 265 +0.4% 1.00x(?)
MonteCarloE 101530 101518 -0.0% 1.00x(?)
SetUnion_OfObjects 26753 26714 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 69303 69370 +0.1% 1.00x(?)
StringHasSuffixUnicode 58549 58725 +0.3% 1.00x(?)
ArrayAppendToGeneric 676 675 -0.1% 1.00x(?)
HashTest 5258 5279 +0.4% 1.00x(?)
SetIsSubsetOf_OfObjects 1732 1734 +0.1% 1.00x(?)
DictionaryRemove 17089 17043 -0.3% 1.00x(?)
StringHasPrefixUnicode 14483 14486 +0.0% 1.00x(?)
LinkedList 26303 26301 -0.0% 1.00x(?)
MapReduceAnyCollection 42373 42449 +0.2% 1.00x
ObjectiveCBridgeFromNSSetAnyObjectForced 6297 6323 +0.4% 1.00x(?)
ArrayAppendArrayOfInt 673 672 -0.1% 1.00x(?)
Chars 6107 6106 -0.0% 1.00x(?)
MapReduceLazyCollection 36476 36494 +0.1% 1.00x(?)
ObserverForwarderStruct 4949 4952 +0.1% 1.00x(?)
ObjectiveCBridgeStubNSDateRefAccess 1122 1126 +0.4% 1.00x(?)
AngryPhonebook 3181 3182 +0.0% 1.00x(?)
SevenBoom 1518 1522 +0.3% 1.00x(?)
SetExclusiveOr 20482 20500 +0.1% 1.00x(?)
ArrayValueProp 2850 2841 -0.3% 1.00x(?)
MapReduceClass 46791 46889 +0.2% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 19423 19420 -0.0% 1.00x(?)
Dictionary2OfObjects 5670 5669 -0.0% 1.00x(?)
ArrayValueProp4 3187 3200 +0.4% 1.00x(?)
ArrayValueProp2 3330 3332 +0.1% 1.00x(?)
ArrayValueProp3 3214 3215 +0.0% 1.00x(?)
168 6750523 6765301 +0.2% 1.00x
ObserverPartiallyAppliedMethod 8213 8198 -0.2% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 150356 151561 +0.8% 0.99x(?)
Histogram 9735 9793 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7023 7084 +0.9% 0.99x(?)
ReversedArray 486 493 +1.4% 0.99x
MapReduceString 2515 2544 +1.1% 0.99x(?)
Integrate 344 349 +1.4% 0.99x
Walsh 12320 12383 +0.5% 0.99x(?)
UTF8Decode 42949 43425 +1.1% 0.99x(?)
NopDeinit 41936 42398 +1.1% 0.99x
RGBHistogramOfObjects 79540 80244 +0.9% 0.99x(?)
Phonebook 19633 19830 +1.0% 0.99x
ObjectiveCBridgeToNSDictionary 58140 58690 +0.9% 0.99x(?)
ReversedBidirectional 127889 128548 +0.5% 0.99x(?)
RGBHistogram 33312 33581 +0.8% 0.99x(?)
ArrayAppendSequence 71324 72281 +1.3% 0.99x(?)
SetUnion 11347 11440 +0.8% 0.99x(?)
DeadArray 118292 118977 +0.6% 0.99x(?)
BitCount 90 91 +1.1% 0.99x
TwoSum 4605 4661 +1.2% 0.99x(?)
DictionaryBridge 2997 3065 +2.3% 0.98x(?)
Prims 12096 12317 +1.8% 0.98x(?)
SortLettersInPlace 2512 2570 +2.3% 0.98x
NSDictionaryCastToSwift 6112 6237 +2.0% 0.98x(?)
ObjectiveCBridgeStubDateAccess 943 972 +3.1% 0.97x
ArrayAppend 3235 3339 +3.2% 0.97x
ObjectiveCBridgeStubFromNSDateRef 3745 3864 +3.2% 0.97x
SortStrings 2338 2467 +5.5% 0.95x
ObjectiveCBridgeStubFromNSStringRef 195 205 +5.1% 0.95x
SortSortedStrings 1179 1238 +5.0% 0.95x
SortStringsUnicode 7795 8190 +5.1% 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

@airspeedswift
Copy link
Member

Hi @codestergit – the hope is that PR #7672 should resolve some of these performance issues. Do you think you could rebase to pull it in, then we can rebenchmark?

@codestergit
Copy link
Contributor Author

@airspeedswift Sure I will do it by tomorrow.
Thanks

@codestergit
Copy link
Contributor Author

codestergit commented Feb 23, 2017

@airspeedswift @dabrahams Rebased the pull request. Please run the benchmark.

I have commented the do/catch block for now. I will uncomment it after benchmarks to see if it is impacting performance. Some of the validation test case will fail because of this.
Thanks

@airspeedswift
Copy link
Member

@swift-ci Please benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (1)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
RGBHistogram 2143 2278 +6.3% 0.94x
Improvement (1)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ClassArrayGetter 13 12 -7.7% 1.08x
No Changes (170)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StringHasSuffix 744 711 -4.4% 1.05x(?)
StrToInt 6011 5820 -3.2% 1.03x
ObjectiveCBridgeStubNSDataAppend 2220 2157 -2.8% 1.03x(?)
ObjectiveCBridgeStubURLAppendPath 201743 196845 -2.4% 1.02x(?)
NSDictionaryCastToSwift 5107 4998 -2.1% 1.02x(?)
ArrayInClass 60 59 -1.7% 1.02x(?)
StringHasPrefixUnicode 13431 13197 -1.7% 1.02x(?)
ObjectiveCBridgeStubFromNSDate 3582 3505 -2.1% 1.02x
ArraySubscript 1441 1425 -1.1% 1.01x(?)
DictionaryBridge 2783 2765 -0.7% 1.01x(?)
ProtocolDispatch2 150 149 -0.7% 1.01x
StringWithCString 148161 147054 -0.8% 1.01x
ObjectAllocation 168 167 -0.6% 1.01x(?)
StringHasSuffixUnicode 57901 57602 -0.5% 1.01x(?)
MapReduceClassShort 4572 4508 -1.4% 1.01x
ObjectiveCBridgeFromNSSetAnyObject 59749 59396 -0.6% 1.01x(?)
Hanoi 3270 3253 -0.5% 1.01x(?)
Dictionary 741 733 -1.1% 1.01x(?)
ObjectiveCBridgeStubDataAppend 3355 3334 -0.6% 1.01x(?)
ObserverPartiallyAppliedMethod 3609 3574 -1.0% 1.01x(?)
ObjectiveCBridgeToNSString 1230 1227 -0.2% 1.00x(?)
DictionarySwapOfObjects 6535 6514 -0.3% 1.00x(?)
StackPromo 21575 21563 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 110087 110554 +0.4% 1.00x(?)
RecursiveOwnedParameter 2011 2011 +0.0% 1.00x
Integrate 247 247 +0.0% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 132084 132390 +0.2% 1.00x(?)
Array2D 1859 1856 -0.2% 1.00x(?)
Histogram 235 235 +0.0% 1.00x
MonteCarloPi 42524 42515 -0.0% 1.00x(?)
ObjectiveCBridgeFromNSStringForced 2222 2211 -0.5% 1.00x(?)
Prims 730 727 -0.4% 1.00x(?)
DictionarySwap 354 354 +0.0% 1.00x
ArrayAppendToFromGeneric 564 563 -0.2% 1.00x(?)
MapReduceString 77 77 +0.0% 1.00x
PopFrontArray 1058 1059 +0.1% 1.00x(?)
MapReduceLazyCollectionShort 57 57 +0.0% 1.00x
StringHasPrefix 600 601 +0.2% 1.00x(?)
ByteSwap 0 0 +0.0% 1.00x
ArrayAppendGenericStructs 1136 1136 +0.0% 1.00x
SuperChars 208448 208703 +0.1% 1.00x(?)
ArrayAppendLazyMap 862 860 -0.2% 1.00x(?)
ArrayPlusEqualFiveElementCollection 57521 57504 -0.0% 1.00x(?)
XorLoop 333 333 +0.0% 1.00x
StringInterpolation 8896 8923 +0.3% 1.00x(?)
ObserverClosure 2065 2065 +0.0% 1.00x
AnyHashableWithAClass 58992 58916 -0.1% 1.00x(?)
CharacterLiteralsSmall 759 759 +0.0% 1.00x
ObjectiveCBridgeStubToNSString 1447 1444 -0.2% 1.00x(?)
ArrayAppendStrings 12280 12283 +0.0% 1.00x(?)
ObjectiveCBridgeStubFromNSStringRef 198 198 +0.0% 1.00x
ObjectiveCBridgeStubFromNSString 880 876 -0.5% 1.00x(?)
StaticArray 132 132 +0.0% 1.00x
ProtocolDispatch 2859 2859 +0.0% 1.00x
TypeFlood 0 0 +0.0% 1.00x
ArrayLiteral 1339 1340 +0.1% 1.00x(?)
ArrayAppendLatin1 42267 42322 +0.1% 1.00x(?)
Walsh 302 303 +0.3% 1.00x(?)
Dictionary3 530 531 +0.2% 1.00x(?)
StrComplexWalk 2794 2792 -0.1% 1.00x(?)
SetIntersect_OfObjects 1409 1408 -0.1% 1.00x(?)
Join 461 461 +0.0% 1.00x
ArrayOfRef 3675 3682 +0.2% 1.00x(?)
ObserverUnappliedMethod 2505 2500 -0.2% 1.00x(?)
ObjectiveCBridgeStubURLAppendPathRef 199045 198364 -0.3% 1.00x(?)
ObjectiveCBridgeToNSSet 34152 34165 +0.0% 1.00x(?)
ArrayAppendOptionals 1136 1136 +0.0% 1.00x
NSError 335 336 +0.3% 1.00x(?)
DictionaryOfObjects 2400 2399 -0.0% 1.00x(?)
PopFrontArrayGeneric 1057 1058 +0.1% 1.00x(?)
StringEqualPointerComparison 6914 6926 +0.2% 1.00x(?)
CaptureProp 763 763 +0.0% 1.00x
PolymorphicCalls 20 20 +0.0% 1.00x
ArrayAppendReserved 698 698 +0.0% 1.00x
Calculator 30 30 +0.0% 1.00x
ArrayAppendFromGeneric 563 563 +0.0% 1.00x
MapReduce 350 350 +0.0% 1.00x
MapReduceSequence 576 576 +0.0% 1.00x
MapReduceShort 2029 2037 +0.4% 1.00x(?)
ObjectiveCBridgeStubDateMutation 257 257 +0.0% 1.00x
ArrayAppendUTF16 39116 39112 -0.0% 1.00x(?)
IterateData 2529 2532 +0.1% 1.00x(?)
DictionaryLiteral 1412 1419 +0.5% 1.00x(?)
OpenClose 48 48 +0.0% 1.00x
DictionaryRemoveOfObjects 20567 20617 +0.2% 1.00x(?)
UTF8Decode 264 264 +0.0% 1.00x
MapReduceLazySequence 44 44 +0.0% 1.00x
SetIsSubsetOf 234 234 +0.0% 1.00x
NopDeinit 20166 20182 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 74798 74446 -0.5% 1.00x(?)
ObjectiveCBridgeStubNSDateRefAccess 323 323 +0.0% 1.00x
StringBuilder 1293 1289 -0.3% 1.00x(?)
ArrayOfGenericPOD 207 207 +0.0% 1.00x
ArrayOfGenericRef 3772 3765 -0.2% 1.00x(?)
ObjectiveCBridgeFromNSString 1350 1354 +0.3% 1.00x(?)
ObjectiveCBridgeStubDateAccess 171 171 +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
MonteCarloE 9935 9954 +0.2% 1.00x(?)
SetUnion_OfObjects 5906 5897 -0.1% 1.00x(?)
ReversedBidirectional 45886 45840 -0.1% 1.00x(?)
RC4 148 148 +0.0% 1.00x
ArrayAppendToGeneric 563 563 +0.0% 1.00x
HashTest 1695 1696 +0.1% 1.00x(?)
SetIsSubsetOf_OfObjects 314 314 +0.0% 1.00x
ArrayAppend 930 930 +0.0% 1.00x
DictionaryRemove 3089 3096 +0.2% 1.00x(?)
LinkedList 7219 7239 +0.3% 1.00x(?)
MapReduceAnyCollection 353 353 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 66780 66628 -0.2% 1.00x(?)
RGBHistogramOfObjects 21578 21572 -0.0% 1.00x(?)
NSStringConversion 694 695 +0.1% 1.00x(?)
MapReduceLazyCollection 84 84 +0.0% 1.00x
ArrayAppendSequence 924 925 +0.1% 1.00x(?)
ArrayAppendArrayOfInt 563 563 +0.0% 1.00x
ArrayOfPOD 156 156 +0.0% 1.00x
Chars 1382 1382 +0.0% 1.00x
ReversedArray 46 46 +0.0% 1.00x
ObserverForwarderStruct 914 914 +0.0% 1.00x
DeadArray 171 171 +0.0% 1.00x
BitCount 1 1 +0.0% 1.00x
AngryPhonebook 2819 2824 +0.2% 1.00x(?)
ArrayPlusEqualArrayOfInt 563 564 +0.2% 1.00x(?)
SevenBoom 1399 1395 -0.3% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 67366 67390 +0.0% 1.00x(?)
StringWalk 5505 5505 +0.0% 1.00x
ArrayValueProp 5 5 +0.0% 1.00x
MapReduceClass 2965 2957 -0.3% 1.00x(?)
ObjectiveCBridgeStubNSDateMutationRef 11964 11954 -0.1% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 222 222 +0.0% 1.00x
Dictionary2OfObjects 3438 3449 +0.3% 1.00x(?)
ArrayValueProp4 5 5 +0.0% 1.00x
TwoSum 1181 1176 -0.4% 1.00x(?)
ArrayValueProp2 5 5 +0.0% 1.00x
ArrayValueProp3 5 5 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObjectToString 40579 41163 +1.4% 0.99x(?)
ObjectiveCBridgeStubFromNSDateRef 3610 3650 +1.1% 0.99x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 4158 4200 +1.0% 0.99x(?)
SortLettersInPlace 1034 1049 +1.4% 0.99x(?)
ReversedDictionary 83 84 +1.2% 0.99x(?)
ArrayAppendASCII 18771 18868 +0.5% 0.99x(?)
Dictionary3OfObjects 907 912 +0.6% 0.99x(?)
RangeAssignment 300 302 +0.7% 0.99x(?)
ArrayPlusEqualSingleElementCollection 54562 54905 +0.6% 0.99x(?)
CharacterLiteralsLarge 11621 11696 +0.7% 0.99x(?)
Dictionary2 1973 1989 +0.8% 0.99x(?)
ObjectiveCBridgeToNSArray 26728 26943 +0.8% 0.99x(?)
ObjectiveCBridgeStubToNSDateRef 3147 3179 +1.0% 0.99x(?)
PopFrontUnsafePointer 8583 8697 +1.3% 0.99x(?)
ObjectiveCBridgeStubToNSStringRef 121 122 +0.8% 0.99x(?)
171 2597227 2611393 +0.6% 0.99x
ObjectiveCBridgeFromNSArrayAnyObject 22195 22332 +0.6% 0.99x(?)
SetExclusiveOr 2317 2331 +0.6% 0.99x(?)
Phonebook 6981 7045 +0.9% 0.99x
SetExclusiveOr_OfObjects 7131 7222 +1.3% 0.99x(?)
ObjectiveCBridgeToNSDictionary 55798 56142 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 3939 3985 +1.2% 0.99x(?)
SetUnion 1878 1889 +0.6% 0.99x(?)
ObjectiveCBridgeStubFromArrayOfNSString 49701 50336 +1.3% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 4575 4664 +1.9% 0.98x(?)
ObjectiveCBridgeStubToNSDate 13444 13654 +1.6% 0.98x(?)
ErrorHandling 2862 2924 +2.2% 0.98x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 89452 91323 +2.1% 0.98x(?)
ObjectiveCBridgeStubToArrayOfNSString 25981 26403 +1.6% 0.98x(?)
SetIntersect 302 308 +2.0% 0.98x
SortStrings 1578 1635 +3.6% 0.97x
SortSortedStrings 786 810 +3.0% 0.97x
SortStringsUnicode 6814 7102 +4.2% 0.96x
**Unoptimized (Onone)**
Regression (6)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ObjectiveCBridgeStubDateMutation 429 486 +13.3% 0.88x
ObjectiveCBridgeStubDataAppend 3463 3737 +7.9% 0.93x(?)
ObjectiveCBridgeStubNSDataAppend 2402 2573 +7.1% 0.93x(?)
SortStrings 2459 2608 +6.1% 0.94x
SortSortedStrings 1251 1335 +6.7% 0.94x
ArrayAppend 3255 3455 +6.1% 0.94x
Improvement (2)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
BitCount 103 97 -5.8% 1.06x
ProtocolDispatch 6292 5730 -8.9% 1.10x
No Changes (164)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ObjectiveCBridgeStubNSDateMutationRef 14657 14054 -4.1% 1.04x(?)
Hanoi 15756 15347 -2.6% 1.03x
ObjectiveCBridgeStubDateAccess 943 918 -2.6% 1.03x
TypeFlood 162 159 -1.9% 1.02x(?)
OpenClose 462 451 -2.4% 1.02x(?)
ArrayAppendRepeatCol 170431 167729 -1.6% 1.02x
DeadArray 122544 120613 -1.6% 1.02x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 139650 138597 -0.8% 1.01x(?)
Histogram 8012 7948 -0.8% 1.01x(?)
ArrayAppendLatin1 97771 96536 -1.3% 1.01x
ArrayAppendASCII 78148 77421 -0.9% 1.01x
ArrayPlusEqualFiveElementCollection 232287 230859 -0.6% 1.01x(?)
ErrorHandling 3980 3923 -1.4% 1.01x(?)
ProtocolDispatch2 400 397 -0.8% 1.01x
ObjectiveCBridgeStubURLAppendPathRef 199940 197726 -1.1% 1.01x(?)
ObjectiveCBridgeStubToNSDateRef 3231 3208 -0.7% 1.01x(?)
ArrayAppendUTF16 97753 96334 -1.4% 1.01x
ArrayOfGenericPOD 3056 3040 -0.5% 1.01x(?)
171 5867699 5835551 -0.6% 1.01x
SetIntersect 9946 9893 -0.5% 1.01x
ObjectiveCBridgeStubNSDateRefAccess 1125 1116 -0.8% 1.01x
StringHasSuffix 1487 1472 -1.0% 1.01x(?)
MapReduceShortString 212 210 -0.9% 1.01x(?)
DictionaryRemove 16999 16890 -0.6% 1.01x
StringHasPrefixUnicode 15002 14909 -0.6% 1.01x(?)
MapReduce 33413 33081 -1.0% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 80731 79541 -1.5% 1.01x(?)
Chars 7006 6934 -1.0% 1.01x(?)
SevenBoom 1531 1516 -1.0% 1.01x(?)
MapReduceClass 38474 38040 -1.1% 1.01x(?)
ObjectiveCBridgeFromNSString 3800 3764 -0.9% 1.01x(?)
TwoSum 4312 4277 -0.8% 1.01x
ArraySubscript 3764 3763 -0.0% 1.00x(?)
ObjectiveCBridgeToNSString 1261 1261 +0.0% 1.00x
DictionarySwapOfObjects 18329 18333 +0.0% 1.00x(?)
RecursiveOwnedParameter 7678 7694 +0.2% 1.00x
Integrate 375 376 +0.3% 1.00x(?)
ClassArrayGetter 812 812 +0.0% 1.00x
Array2D 525274 525399 +0.0% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 6914 6905 -0.1% 1.00x(?)
MonteCarloPi 50588 50400 -0.4% 1.00x
StringWithCString 301331 301343 +0.0% 1.00x(?)
Prims 8042 8064 +0.3% 1.00x(?)
DictionarySwap 4964 4985 +0.4% 1.00x
ReversedDictionary 21470 21545 +0.3% 1.00x(?)
ArrayAppendToFromGeneric 614 615 +0.2% 1.00x
MapReduceString 2075 2068 -0.3% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 113827 114154 +0.3% 1.00x(?)
Dictionary3OfObjects 1988 1991 +0.1% 1.00x(?)
RangeAssignment 5036 5042 +0.1% 1.00x(?)
MapReduceLazyCollectionShort 38049 37986 -0.2% 1.00x(?)
ByteSwap 9 9 +0.0% 1.00x
ArrayAppendGenericStructs 1189 1189 +0.0% 1.00x
SuperChars 255784 255280 -0.2% 1.00x(?)
ArrayAppendLazyMap 204992 205257 +0.1% 1.00x(?)
XorLoop 18102 18100 -0.0% 1.00x(?)
ArrayAppendReserved 3104 3108 +0.1% 1.00x
StringInterpolation 14055 13990 -0.5% 1.00x(?)
ObserverClosure 6207 6208 +0.0% 1.00x(?)
AnyHashableWithAClass 73560 73611 +0.1% 1.00x(?)
CharacterLiteralsSmall 969 969 +0.0% 1.00x
ObjectiveCBridgeStubToNSString 1479 1479 +0.0% 1.00x
ArrayPlusEqualSingleElementCollection 229250 229995 +0.3% 1.00x(?)
ArrayAppendStrings 12267 12275 +0.1% 1.00x(?)
StaticArray 4311 4310 -0.0% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObject 63555 63531 -0.0% 1.00x(?)
CharacterLiteralsLarge 13225 13219 -0.1% 1.00x(?)
Dictionary3 1231 1233 +0.2% 1.00x(?)
SetIntersect_OfObjects 10449 10434 -0.1% 1.00x(?)
Join 1244 1240 -0.3% 1.00x(?)
ArrayOfRef 7926 7941 +0.2% 1.00x(?)
ObserverUnappliedMethod 7912 7884 -0.3% 1.00x(?)
ArrayAppendOptionals 1190 1190 +0.0% 1.00x
ObjectiveCBridgeToNSArray 26544 26562 +0.1% 1.00x(?)
DictionaryOfObjects 4454 4467 +0.3% 1.00x(?)
PopFrontUnsafePointer 151405 151676 +0.2% 1.00x(?)
StringEqualPointerComparison 9056 9059 +0.0% 1.00x(?)
CaptureProp 92191 92454 +0.3% 1.00x(?)
PolymorphicCalls 721 721 +0.0% 1.00x
RC4 5851 5837 -0.2% 1.00x(?)
ObjectiveCBridgeStubToNSStringRef 139 139 +0.0% 1.00x
ArrayAppendFromGeneric 617 617 +0.0% 1.00x
ArrayPlusEqualArrayOfInt 612 613 +0.2% 1.00x(?)
MapReduceSequence 37433 37498 +0.2% 1.00x(?)
MapReduceShort 42308 42307 -0.0% 1.00x(?)
IterateData 9741 9750 +0.1% 1.00x
DictionaryLiteral 11656 11671 +0.1% 1.00x(?)
DictionaryRemoveOfObjects 48731 48799 +0.1% 1.00x(?)
UTF8Decode 34124 34138 +0.0% 1.00x(?)
MapReduceLazySequence 24658 24642 -0.1% 1.00x(?)
SetExclusiveOr 19060 19003 -0.3% 1.00x(?)
SetIsSubsetOf 1512 1511 -0.1% 1.00x
Dictionary 1664 1666 +0.1% 1.00x(?)
ObjectiveCBridgeStubToArrayOfNSString 26513 26610 +0.4% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObject 23999 24059 +0.2% 1.00x(?)
MapReduceClassShort 46246 46263 +0.0% 1.00x(?)
ArrayInClass 3611 3612 +0.0% 1.00x(?)
ArrayOfGenericRef 9012 9011 -0.0% 1.00x(?)
Sim2DArray 23606 23595 -0.1% 1.00x(?)
SetExclusiveOr_OfObjects 37100 37038 -0.2% 1.00x(?)
ObjectiveCBridgeToNSDictionary 56663 56835 +0.3% 1.00x(?)
MonteCarloE 75625 75555 -0.1% 1.00x
SetUnion_OfObjects 26350 26355 +0.0% 1.00x(?)
ReversedBidirectional 117738 117300 -0.4% 1.00x(?)
StringHasSuffixUnicode 59182 59117 -0.1% 1.00x(?)
ArrayAppendToGeneric 616 617 +0.2% 1.00x
HashTest 5071 5076 +0.1% 1.00x(?)
SetIsSubsetOf_OfObjects 1462 1463 +0.1% 1.00x
ObjectiveCBridgeToNSSet 34335 34426 +0.3% 1.00x(?)
LinkedList 27268 27276 +0.0% 1.00x(?)
MapReduceAnyCollection 33277 33190 -0.3% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 70266 70501 +0.3% 1.00x(?)
NSStringConversion 1181 1177 -0.3% 1.00x(?)
ArrayAppendSequence 67975 67720 -0.4% 1.00x(?)
ArrayAppendArrayOfInt 611 611 +0.0% 1.00x
SetUnion 10553 10554 +0.0% 1.00x(?)
ReversedArray 463 464 +0.2% 1.00x(?)
ObserverForwarderStruct 4348 4351 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 68801 68618 -0.3% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 34544 34533 -0.0% 1.00x(?)
Dictionary2OfObjects 5731 5733 +0.0% 1.00x(?)
ArrayValueProp2 3682 3682 +0.0% 1.00x
ArrayValueProp3 3596 3601 +0.1% 1.00x(?)
ObjectiveCBridgeStubFromNSDate 3591 3602 +0.3% 1.00x(?)
ObserverPartiallyAppliedMethod 7659 7630 -0.4% 1.00x(?)
StackPromo 91521 92362 +0.9% 0.99x(?)
DictionaryBridge 2842 2863 +0.7% 0.99x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 7238 7303 +0.9% 0.99x(?)
ObjectiveCBridgeStubFromNSString 892 903 +1.2% 0.99x(?)
ObjectAllocation 611 615 +0.7% 0.99x(?)
Dictionary2 3503 3526 +0.7% 0.99x(?)
StrComplexWalk 8017 8062 +0.6% 0.99x(?)
NSError 703 708 +0.7% 0.99x(?)
PopFrontArrayGeneric 6925 7004 +1.1% 0.99x
Calculator 975 982 +0.7% 0.99x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 92734 93543 +0.9% 0.99x(?)
RGBHistogramOfObjects 76744 77334 +0.8% 0.99x(?)
StringBuilder 2702 2730 +1.0% 0.99x(?)
MapReduceLazyCollection 29995 30305 +1.0% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 6644 6704 +0.9% 0.99x(?)
RGBHistogram 28964 29337 +1.3% 0.99x(?)
StrToInt 6832 6870 +0.6% 0.99x(?)
AngryPhonebook 2963 2998 +1.2% 0.99x(?)
ArrayValueProp 3188 3207 +0.6% 0.99x(?)
ObjectiveCBridgeStubFromArrayOfNSString 50003 50660 +1.3% 0.99x(?)
ArrayValueProp4 3510 3531 +0.6% 0.99x
PopFrontArray 9004 9174 +1.9% 0.98x
ObjectiveCBridgeFromNSArrayAnyObjectToString 41842 42638 +1.9% 0.98x(?)
ObjectiveCBridgeStubFromNSDateRef 3691 3774 +2.2% 0.98x
ObjectiveCBridgeFromNSStringForced 2510 2556 +1.8% 0.98x
StringHasPrefix 1546 1583 +2.4% 0.98x
ObjectiveCBridgeStubToNSDate 14119 14358 +1.7% 0.98x(?)
ArrayLiteral 1538 1571 +2.1% 0.98x(?)
Walsh 9608 9786 +1.9% 0.98x
Phonebook 20277 20787 +2.5% 0.98x
StringWalk 20551 20897 +1.7% 0.98x
SortLettersInPlace 2504 2570 +2.6% 0.97x
ObjectiveCBridgeStubURLAppendPath 201298 208296 +3.5% 0.97x(?)
SortStringsUnicode 8065 8338 +3.4% 0.97x
NopDeinit 43193 44647 +3.4% 0.97x
NSDictionaryCastToSwift 6262 6481 +3.5% 0.97x(?)
ArrayOfPOD 1728 1784 +3.2% 0.97x
ObjectiveCBridgeStubFromNSStringRef 196 204 +4.1% 0.96x
**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

@airspeedswift
Copy link
Member

Much better! @codestergit want to try putting that do/catch back in?

@codestergit
Copy link
Contributor Author

codestergit commented Feb 24, 2017

@airspeedswift @dabrahams Great!!
Added do/catch block. Updated the pull request. Please run the benchmark again.
Thanks

@rintaro
Copy link
Member

rintaro commented Feb 24, 2017

@swift-ci Please benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (3)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
OpenClose 48 54 +12.5% 0.89x
Chars 1382 1499 +8.5% 0.92x
NopDeinit 20169 21594 +7.1% 0.93x
Improvement (3)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
MapReduce 350 329 -6.0% 1.06x
MapReduceAnyCollection 353 326 -7.7% 1.08x
ObjectiveCBridgeStubNSDateRefAccess 323 294 -9.0% 1.10x
No Changes (166)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
MapReduceString 77 75 -2.6% 1.03x(?)
ArrayInClass 60 58 -3.3% 1.03x(?)
StrToInt 6017 5858 -2.6% 1.03x(?)
ObjectiveCBridgeStubNSDataAppend 2182 2117 -3.0% 1.03x(?)
ObjectiveCBridgeFromNSString 1347 1322 -1.9% 1.02x(?)
Join 462 453 -1.9% 1.02x
SetExclusiveOr 2333 2292 -1.8% 1.02x(?)
171 2628743 2587361 -1.6% 1.02x
Dictionary 740 724 -2.2% 1.02x(?)
StringHasSuffix 745 728 -2.3% 1.02x(?)
StringHasPrefixUnicode 13439 13176 -2.0% 1.02x
MapReduceClass 2972 2916 -1.9% 1.02x
Array2D 1852 1834 -1.0% 1.01x(?)
StringWithCString 148246 147050 -0.8% 1.01x
ObjectiveCBridgeFromNSStringForced 2218 2200 -0.8% 1.01x
StringInterpolation 8906 8830 -0.8% 1.01x(?)
ObjectAllocation 168 167 -0.6% 1.01x(?)
StringHasSuffixUnicode 57931 57584 -0.6% 1.01x(?)
ObjectiveCBridgeStubToNSDateRef 3184 3159 -0.8% 1.01x(?)
Hanoi 3281 3239 -1.3% 1.01x(?)
MapReduceClassShort 4563 4532 -0.7% 1.01x(?)
Phonebook 6985 6928 -0.8% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 67025 66659 -0.6% 1.01x(?)
DictionaryRemove 3096 3055 -1.3% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 74947 74338 -0.8% 1.01x(?)
SetUnion 1875 1860 -0.8% 1.01x(?)
ObjectiveCBridgeStubFromNSDateRef 3601 3579 -0.6% 1.01x(?)
Dictionary2OfObjects 3456 3426 -0.9% 1.01x(?)
ArraySubscript 1436 1433 -0.2% 1.00x(?)
ObjectiveCBridgeToNSString 1231 1230 -0.1% 1.00x(?)
DictionarySwapOfObjects 6585 6586 +0.0% 1.00x(?)
StackPromo 22283 22317 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 109568 110069 +0.5% 1.00x(?)
RecursiveOwnedParameter 2010 2012 +0.1% 1.00x(?)
Integrate 247 247 +0.0% 1.00x
ClassArrayGetter 12 12 +0.0% 1.00x
ReversedArray 46 46 +0.0% 1.00x
MonteCarloPi 42514 42346 -0.4% 1.00x
DictionarySwap 355 354 -0.3% 1.00x(?)
ReversedDictionary 84 84 +0.0% 1.00x
ArrayAppendToFromGeneric 563 563 +0.0% 1.00x
PopFrontArray 1058 1056 -0.2% 1.00x(?)
ArrayAppendASCII 18778 18832 +0.3% 1.00x(?)
Dictionary3OfObjects 909 912 +0.3% 1.00x(?)
StringHasPrefix 600 600 +0.0% 1.00x
ByteSwap 0 0 +0.0% 1.00x
ArrayAppendGenericStructs 1136 1136 +0.0% 1.00x
SuperChars 208334 208684 +0.2% 1.00x(?)
ArrayAppendLazyMap 862 861 -0.1% 1.00x(?)
ArrayPlusEqualFiveElementCollection 57633 57504 -0.2% 1.00x(?)
XorLoop 333 333 +0.0% 1.00x
ObserverClosure 2063 2062 -0.1% 1.00x(?)
AnyHashableWithAClass 58493 58499 +0.0% 1.00x(?)
CharacterLiteralsSmall 759 760 +0.1% 1.00x(?)
ObjectiveCBridgeStubToNSString 1447 1443 -0.3% 1.00x(?)
ArrayPlusEqualSingleElementCollection 54692 54675 -0.0% 1.00x(?)
ArrayAppendStrings 12288 12285 -0.0% 1.00x(?)
ObjectiveCBridgeStubFromNSStringRef 198 198 +0.0% 1.00x
ObjectiveCBridgeStubFromNSString 884 883 -0.1% 1.00x(?)
ProtocolDispatch 2859 2859 +0.0% 1.00x
TypeFlood 0 0 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObject 59700 59637 -0.1% 1.00x(?)
ArrayLiteral 1340 1341 +0.1% 1.00x(?)
ArrayAppendLatin1 42267 42235 -0.1% 1.00x(?)
Dictionary3 531 530 -0.2% 1.00x(?)
Dictionary2 1974 1975 +0.1% 1.00x(?)
StrComplexWalk 2797 2795 -0.1% 1.00x(?)
SetIntersect_OfObjects 1409 1410 +0.1% 1.00x(?)
ArrayOfRef 3677 3677 +0.0% 1.00x
ObserverUnappliedMethod 2516 2516 +0.0% 1.00x
ObjectiveCBridgeToNSSet 34009 33971 -0.1% 1.00x(?)
ArrayAppendOptionals 1136 1136 +0.0% 1.00x
DictionaryOfObjects 2405 2407 +0.1% 1.00x(?)
PopFrontArrayGeneric 1057 1055 -0.2% 1.00x(?)
StringEqualPointerComparison 6915 6923 +0.1% 1.00x(?)
CaptureProp 763 763 +0.0% 1.00x
PolymorphicCalls 20 20 +0.0% 1.00x
ArrayAppendReserved 698 698 +0.0% 1.00x
ObjectiveCBridgeStubToNSStringRef 122 122 +0.0% 1.00x
ArrayAppendFromGeneric 563 563 +0.0% 1.00x
ObjectiveCBridgeStubDateMutation 257 257 +0.0% 1.00x
MapReduceSequence 577 577 +0.0% 1.00x
MapReduceShort 2034 2039 +0.2% 1.00x(?)
ArrayAppendUTF16 39110 39155 +0.1% 1.00x(?)
IterateData 2525 2534 +0.4% 1.00x(?)
DictionaryLiteral 1405 1403 -0.1% 1.00x(?)
ArrayOfGenericPOD 207 207 +0.0% 1.00x
DictionaryRemoveOfObjects 20528 20547 +0.1% 1.00x(?)
UTF8Decode 264 264 +0.0% 1.00x
MapReduceLazySequence 44 44 +0.0% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 90989 91203 +0.2% 1.00x(?)
SetIsSubsetOf 234 234 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObject 22218 22129 -0.4% 1.00x(?)
ObjectiveCBridgeStubDataAppend 3369 3377 +0.2% 1.00x(?)
StringBuilder 1297 1292 -0.4% 1.00x(?)
ArrayOfGenericRef 3769 3758 -0.3% 1.00x(?)
ObjectiveCBridgeStubDateAccess 171 171 +0.0% 1.00x
Sim2DArray 260 260 +0.0% 1.00x
ArrayAppendRepeatCol 791 792 +0.1% 1.00x(?)
MapReduceShortString 19 19 +0.0% 1.00x
MonteCarloE 9934 9927 -0.1% 1.00x(?)
SetUnion_OfObjects 5878 5896 +0.3% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
ArrayAppendToGeneric 563 563 +0.0% 1.00x
HashTest 1693 1695 +0.1% 1.00x(?)
SetIsSubsetOf_OfObjects 314 314 +0.0% 1.00x
ArrayAppend 930 930 +0.0% 1.00x
LinkedList 7200 7199 -0.0% 1.00x(?)
ReversedBidirectional 45891 45867 -0.1% 1.00x(?)
NSStringConversion 693 693 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObjectForced 3937 3950 +0.3% 1.00x(?)
ArrayAppendSequence 924 924 +0.0% 1.00x
ArrayAppendArrayOfInt 564 563 -0.2% 1.00x(?)
ArrayOfPOD 156 156 +0.0% 1.00x
MapReduceLazyCollection 84 84 +0.0% 1.00x
ObserverForwarderStruct 914 911 -0.3% 1.00x(?)
BitCount 1 1 +0.0% 1.00x
AngryPhonebook 2826 2830 +0.1% 1.00x(?)
ArrayPlusEqualArrayOfInt 564 563 -0.2% 1.00x(?)
SevenBoom 1401 1397 -0.3% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 67429 67213 -0.3% 1.00x(?)
StringWalk 5505 5505 +0.0% 1.00x
ArrayValueProp 5 5 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 50141 49981 -0.3% 1.00x(?)
Memset 221 221 +0.0% 1.00x
ArrayValueProp4 5 5 +0.0% 1.00x
TwoSum 1177 1182 +0.4% 1.00x(?)
ArrayValueProp2 5 5 +0.0% 1.00x
ArrayValueProp3 5 5 +0.0% 1.00x
ObjectiveCBridgeStubFromNSDate 3576 3562 -0.4% 1.00x(?)
ObserverPartiallyAppliedMethod 3591 3591 +0.0% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 131947 132743 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 40782 41378 +1.5% 0.99x(?)
Histogram 237 239 +0.8% 0.99x(?)
DictionaryBridge 2750 2770 +0.7% 0.99x(?)
ProtocolDispatch2 150 151 +0.7% 0.99x
ObjectiveCBridgeFromNSArrayAnyObjectForced 4153 4205 +1.2% 0.99x(?)
SortLettersInPlace 1031 1045 +1.4% 0.99x(?)
RangeAssignment 300 304 +1.3% 0.99x(?)
CharacterLiteralsLarge 11673 11772 +0.8% 0.99x(?)
ObjectiveCBridgeStubURLAppendPathRef 199422 201830 +1.2% 0.99x(?)
ObjectiveCBridgeToNSArray 26717 26945 +0.8% 0.99x(?)
NSError 333 335 +0.6% 0.99x(?)
ObjectiveCBridgeStubURLAppendPath 199029 200087 +0.5% 0.99x(?)
RGBHistogramOfObjects 21541 21653 +0.5% 0.99x(?)
SetExclusiveOr_OfObjects 7125 7191 +0.9% 0.99x(?)
ObjectiveCBridgeToNSDictionary 55405 55898 +0.9% 0.99x(?)
RC4 148 149 +0.7% 0.99x
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 4567 4656 +1.9% 0.98x(?)
StaticArray 134 137 +2.2% 0.98x(?)
SortSortedStrings 787 805 +2.3% 0.98x
ErrorHandling 2936 3004 +2.3% 0.98x(?)
PopFrontUnsafePointer 8584 8734 +1.8% 0.98x(?)
SetIntersect 302 309 +2.3% 0.98x
DeadArray 171 174 +1.8% 0.98x
ObjectiveCBridgeStubNSDateMutationRef 11671 11917 +2.1% 0.98x(?)
SortStrings 1578 1633 +3.5% 0.97x
Prims 729 752 +3.2% 0.97x
Calculator 30 31 +3.3% 0.97x
NSDictionaryCastToSwift 5004 5181 +3.5% 0.97x(?)
ObjectiveCBridgeStubToNSDate 13482 14018 +4.0% 0.96x(?)
Walsh 302 313 +3.6% 0.96x
SortStringsUnicode 6818 7087 +4.0% 0.96x(?)
ObjectiveCBridgeStubToArrayOfNSString 25620 26669 +4.1% 0.96x(?)
RGBHistogram 2149 2246 +4.5% 0.96x
MapReduceLazyCollectionShort 57 60 +5.3% 0.95x
**Unoptimized (Onone)**
Regression (2)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ObjectiveCBridgeStubDateMutation 429 457 +6.5% 0.94x
ReversedArray 464 493 +6.2% 0.94x
Improvement (3)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
NSDictionaryCastToSwift 6493 6102 -6.0% 1.06x(?)
ArrayOfGenericPOD 3057 2889 -5.5% 1.06x
OpenClose 530 437 -17.6% 1.21x
No Changes (167)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ArrayAppendReserved 3106 2950 -5.0% 1.05x
ProtocolDispatch 6292 6017 -4.4% 1.05x
TypeFlood 161 156 -3.1% 1.03x(?)
RC4 6189 6007 -2.9% 1.03x(?)
ObjectiveCBridgeStubDateAccess 943 916 -2.9% 1.03x
ArrayAppendLatin1 97701 96071 -1.7% 1.02x
ArrayAppendASCII 78192 76583 -2.1% 1.02x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 69424 68074 -1.9% 1.02x(?)
NSError 713 699 -2.0% 1.02x(?)
ArrayAppendUTF16 97601 95489 -2.2% 1.02x
Hanoi 15692 15458 -1.5% 1.02x
ObjectiveCBridgeStubToArrayOfNSString 26896 26444 -1.7% 1.02x(?)
ArrayAppendRepeatCol 173679 169660 -2.3% 1.02x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 71629 70118 -2.1% 1.02x(?)
BitCount 104 102 -1.9% 1.02x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 136510 135262 -0.9% 1.01x(?)
DictionarySwap 5011 4961 -1.0% 1.01x
ErrorHandling 4000 3960 -1.0% 1.01x(?)
ObjectiveCBridgeStubFromNSString 906 899 -0.8% 1.01x(?)
ProtocolDispatch2 400 398 -0.5% 1.01x
Dictionary3 1232 1225 -0.6% 1.01x(?)
SetIntersect_OfObjects 10485 10392 -0.9% 1.01x
ObjectiveCBridgeToNSSet 34511 34122 -1.1% 1.01x(?)
IterateData 9697 9636 -0.6% 1.01x
DictionaryLiteral 12074 11959 -0.9% 1.01x(?)
171 5860198 5813059 -0.8% 1.01x
NopDeinit 46025 45658 -0.8% 1.01x
SetIntersect 9921 9864 -0.6% 1.01x
ObjectiveCBridgeStubNSDateRefAccess 1127 1118 -0.8% 1.01x
ObjectiveCBridgeToNSDictionary 56693 56120 -1.0% 1.01x(?)
StringHasPrefixUnicode 15019 14907 -0.8% 1.01x
ReversedBidirectional 118121 117043 -0.9% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 80444 79397 -1.3% 1.01x(?)
ArrayAppendSequence 68204 67829 -0.6% 1.01x
SetUnion 10304 10201 -1.0% 1.01x(?)
Chars 6987 6936 -0.7% 1.01x
StringBuilder 2733 2708 -0.9% 1.01x(?)
ObserverForwarderStruct 4269 4243 -0.6% 1.01x(?)
ArrayValueProp 3217 3195 -0.7% 1.01x(?)
TwoSum 4337 4315 -0.5% 1.01x(?)
ObjectiveCBridgeStubFromNSDate 3619 3590 -0.8% 1.01x(?)
ArraySubscript 3764 3763 -0.0% 1.00x(?)
ObjectiveCBridgeToNSString 1262 1261 -0.1% 1.00x(?)
DictionarySwapOfObjects 18280 18353 +0.4% 1.00x(?)
StackPromo 91833 91689 -0.2% 1.00x(?)
RecursiveOwnedParameter 7699 7714 +0.2% 1.00x
ObjectiveCBridgeStubToNSString 1486 1485 -0.1% 1.00x
ClassArrayGetter 812 811 -0.1% 1.00x(?)
Array2D 525850 525119 -0.1% 1.00x(?)
Histogram 8056 8064 +0.1% 1.00x(?)
DictionaryBridge 2865 2856 -0.3% 1.00x(?)
MonteCarloPi 50579 50438 -0.3% 1.00x
StringWithCString 301333 301473 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 7283 7268 -0.2% 1.00x(?)
Prims 8057 8048 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSString 3744 3738 -0.2% 1.00x(?)
ArrayAppendToFromGeneric 616 616 +0.0% 1.00x
MapReduceString 2057 2067 +0.5% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObject 113482 113746 +0.2% 1.00x(?)
Dictionary3OfObjects 1976 1978 +0.1% 1.00x(?)
RangeAssignment 5021 5024 +0.1% 1.00x(?)
MapReduceLazyCollectionShort 37946 38036 +0.2% 1.00x(?)
StrComplexWalk 8017 8046 +0.4% 1.00x(?)
ByteSwap 9 9 +0.0% 1.00x
ArrayAppendGenericStructs 1190 1189 -0.1% 1.00x(?)
SuperChars 255718 255597 -0.1% 1.00x(?)
ArrayAppendLazyMap 205045 204939 -0.1% 1.00x(?)
XorLoop 18103 18101 -0.0% 1.00x(?)
StringInterpolation 14049 14079 +0.2% 1.00x(?)
ObserverClosure 6242 6216 -0.4% 1.00x(?)
AnyHashableWithAClass 73609 73843 +0.3% 1.00x(?)
CharacterLiteralsSmall 969 969 +0.0% 1.00x
Integrate 373 372 -0.3% 1.00x(?)
ArrayPlusEqualSingleElementCollection 229180 228539 -0.3% 1.00x(?)
ArrayAppendStrings 12286 12267 -0.1% 1.00x(?)
StaticArray 4310 4305 -0.1% 1.00x(?)
ObjectAllocation 610 610 +0.0% 1.00x
ObjectiveCBridgeFromNSSetAnyObject 62852 62843 -0.0% 1.00x(?)
ArrayLiteral 1572 1572 +0.0% 1.00x
Walsh 9696 9726 +0.3% 1.00x(?)
Join 1242 1246 +0.3% 1.00x(?)
ArrayOfRef 7984 7958 -0.3% 1.00x(?)
ObserverUnappliedMethod 7991 8011 +0.2% 1.00x(?)
ArrayAppendOptionals 1189 1190 +0.1% 1.00x(?)
DictionaryOfObjects 4438 4454 +0.4% 1.00x(?)
ObjectiveCBridgeStubToNSDateRef 3214 3217 +0.1% 1.00x(?)
PopFrontUnsafePointer 151487 151782 +0.2% 1.00x
StringEqualPointerComparison 9034 9049 +0.2% 1.00x(?)
PolymorphicCalls 722 722 +0.0% 1.00x
ObjectiveCBridgeStubToNSStringRef 139 139 +0.0% 1.00x
ArrayAppendFromGeneric 615 615 +0.0% 1.00x
MapReduceSequence 37410 37483 +0.2% 1.00x(?)
MapReduceShort 42268 42295 +0.1% 1.00x(?)
DictionaryRemoveOfObjects 48782 48677 -0.2% 1.00x(?)
ObjectiveCBridgeStubURLAppendPath 202907 202750 -0.1% 1.00x(?)
SetIsSubsetOf 1510 1506 -0.3% 1.00x(?)
ObjectiveCBridgeStubDataAppend 3598 3610 +0.3% 1.00x(?)
ArrayInClass 3607 3609 +0.1% 1.00x(?)
ArrayOfGenericRef 8957 8959 +0.0% 1.00x(?)
StringHasSuffix 1487 1489 +0.1% 1.00x(?)
Sim2DArray 23592 23586 -0.0% 1.00x(?)
SetExclusiveOr_OfObjects 36924 36869 -0.1% 1.00x(?)
MapReduceShortString 211 212 +0.5% 1.00x(?)
MonteCarloE 75244 75416 +0.2% 1.00x(?)
SetUnion_OfObjects 26307 26258 -0.2% 1.00x
StringHasSuffixUnicode 59148 59206 +0.1% 1.00x(?)
ArrayAppendToGeneric 616 615 -0.2% 1.00x(?)
SetIsSubsetOf_OfObjects 1462 1461 -0.1% 1.00x(?)
DictionaryRemove 17377 17348 -0.2% 1.00x(?)
LinkedList 27472 27470 -0.0% 1.00x(?)
MapReduceAnyCollection 33354 33379 +0.1% 1.00x(?)
NSStringConversion 1180 1182 +0.2% 1.00x(?)
MapReduceLazyCollection 29869 29942 +0.2% 1.00x(?)
ArrayAppendArrayOfInt 610 611 +0.2% 1.00x
RGBHistogram 29116 29180 +0.2% 1.00x(?)
DeadArray 122265 122183 -0.1% 1.00x(?)
ArrayValueProp2 3713 3717 +0.1% 1.00x(?)
AngryPhonebook 2997 2983 -0.5% 1.00x(?)
ArrayPlusEqualArrayOfInt 613 612 -0.2% 1.00x(?)
SevenBoom 1528 1522 -0.4% 1.00x(?)
SetExclusiveOr 19339 19244 -0.5% 1.00x(?)
MapReduceClass 38351 38523 +0.5% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 34540 34545 +0.0% 1.00x(?)
ArrayValueProp4 3417 3415 -0.1% 1.00x(?)
ArrayValueProp3 3594 3587 -0.2% 1.00x(?)
ObserverPartiallyAppliedMethod 7684 7683 -0.0% 1.00x(?)
PopFrontArray 8978 9104 +1.4% 0.99x
ObjectiveCBridgeFromNSArrayAnyObjectToString 42278 42650 +0.9% 0.99x(?)
ObjectiveCBridgeStubFromNSDateRef 3660 3690 +0.8% 0.99x
ReversedDictionary 21480 21720 +1.1% 0.99x(?)
ArrayPlusEqualFiveElementCollection 230605 232175 +0.7% 0.99x(?)
CharacterLiteralsLarge 13236 13329 +0.7% 0.99x
Dictionary2 3506 3533 +0.8% 0.99x(?)
ObjectiveCBridgeStubURLAppendPathRef 201509 203050 +0.8% 0.99x(?)
ObjectiveCBridgeToNSArray 26485 26696 +0.8% 0.99x(?)
CaptureProp 92563 93157 +0.6% 0.99x(?)
Calculator 977 989 +1.2% 0.99x
UTF8Decode 34123 34317 +0.6% 0.99x(?)
MapReduceLazySequence 24728 24933 +0.8% 0.99x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 91816 92395 +0.6% 0.99x(?)
Dictionary 1657 1672 +0.9% 0.99x
MapReduceClassShort 45955 46374 +0.9% 0.99x(?)
RGBHistogramOfObjects 79971 80462 +0.6% 0.99x(?)
HashTest 5059 5101 +0.8% 0.99x(?)
StringWalk 20606 20911 +1.5% 0.99x
ObjectiveCBridgeStubFromArrayOfNSString 50265 50545 +0.6% 0.99x(?)
Dictionary2OfObjects 5719 5800 +1.4% 0.99x(?)
ObjectiveCBridgeFromNSStringForced 2506 2555 +2.0% 0.98x(?)
SortLettersInPlace 2516 2566 +2.0% 0.98x
ObjectiveCBridgeStubToNSDate 14238 14562 +2.3% 0.98x(?)
ObjectiveCBridgeStubFromNSStringRef 193 197 +2.1% 0.98x
PopFrontArrayGeneric 6677 6805 +1.9% 0.98x
MapReduce 33491 34012 +1.6% 0.98x(?)
StrToInt 6806 6923 +1.7% 0.98x
SortStringsUnicode 8107 8361 +3.1% 0.97x
ObjectiveCBridgeFromNSArrayAnyObject 23676 24407 +3.1% 0.97x
Phonebook 20334 20869 +2.6% 0.97x
ArrayAppend 3256 3343 +2.7% 0.97x
ObjectiveCBridgeFromNSSetAnyObjectForced 6627 6801 +2.6% 0.97x(?)
ArrayOfPOD 1728 1784 +3.2% 0.97x
ObjectiveCBridgeStubNSDateMutationRef 13903 14331 +3.1% 0.97x(?)
SortStrings 2490 2584 +3.8% 0.96x
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 6812 7096 +4.2% 0.96x(?)
StringHasPrefix 1546 1615 +4.5% 0.96x
ObjectiveCBridgeStubNSDataAppend 2455 2569 +4.6% 0.96x
SortSortedStrings 1263 1326 +5.0% 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

@rintaro
Copy link
Member

rintaro commented Feb 24, 2017

@swift-ci Please benchmark

@codestergit
Copy link
Contributor Author

codestergit commented Feb 24, 2017

@rintaro Thanks for running benchmarks.
Can you please run other tests (smoke and validation) also.

@airspeedswift @dabrahams
Benchmark results looks good. 😁
I think #7672 resolved the performance issue.
Please let me know if you need any other changes.
Thanks

@rintaro
Copy link
Member

rintaro commented Feb 24, 2017

Let's run full test.
@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 7b6cfa346c3f45d50d8f8d8827ede595df4be0ae
Test requested by - @rintaro

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 7b6cfa346c3f45d50d8f8d8827ede595df4be0ae
Test requested by - @rintaro

@rintaro
Copy link
Member

rintaro commented Feb 24, 2017

Linux test failed with unrelated test case (Syntax)
@swift-ci Please smoke test Linux platform

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (3)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
OpenClose 48 54 +12.5% 0.89x
Chars 1382 1499 +8.5% 0.92x
NopDeinit 20173 21596 +7.0% 0.93x
Improvement (3)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
MapReduce 350 330 -5.7% 1.06x
MapReduceAnyCollection 353 327 -7.4% 1.08x
ObjectiveCBridgeStubNSDateRefAccess 323 294 -9.0% 1.10x
No Changes (166)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StringHasSuffix 751 716 -4.7% 1.05x(?)
MapReduceString 77 75 -2.6% 1.03x(?)
StrToInt 6014 5852 -2.7% 1.03x
ObjectiveCBridgeStubNSDataAppend 2178 2124 -2.5% 1.03x(?)
Join 462 455 -1.5% 1.02x
Dictionary 740 725 -2.0% 1.02x
ObjectiveCBridgeFromNSString 1342 1321 -1.6% 1.02x(?)
StringHasPrefixUnicode 13428 13185 -1.8% 1.02x
Array2D 1853 1841 -0.7% 1.01x(?)
StringWithCString 148233 147085 -0.8% 1.01x(?)
ObjectiveCBridgeFromNSStringForced 2219 2200 -0.9% 1.01x(?)
ReversedDictionary 84 83 -1.2% 1.01x(?)
RangeAssignment 301 298 -1.0% 1.01x(?)
StringInterpolation 8875 8825 -0.6% 1.01x(?)
CharacterLiteralsLarge 11777 11683 -0.8% 1.01x(?)
ObjectAllocation 168 167 -0.6% 1.01x(?)
ObjectiveCBridgeStubURLAppendPathRef 199628 196867 -1.4% 1.01x(?)
Hanoi 3281 3243 -1.2% 1.01x(?)
SetExclusiveOr 2350 2318 -1.4% 1.01x(?)
MapReduceClassShort 4562 4536 -0.6% 1.01x
StringBuilder 1304 1291 -1.0% 1.01x(?)
Phonebook 6982 6930 -0.7% 1.01x
DictionaryRemove 3096 3059 -1.2% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 74863 74300 -0.8% 1.01x(?)
SetUnion 1888 1864 -1.3% 1.01x(?)
ObjectiveCBridgeStubFromNSDateRef 3617 3577 -1.1% 1.01x(?)
MapReduceClass 2952 2916 -1.2% 1.01x(?)
Dictionary2OfObjects 3450 3429 -0.6% 1.01x(?)
ArraySubscript 1440 1435 -0.3% 1.00x(?)
ObjectiveCBridgeToNSString 1230 1229 -0.1% 1.00x(?)
DictionarySwapOfObjects 6581 6585 +0.1% 1.00x(?)
StackPromo 22281 22318 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 109970 110108 +0.1% 1.00x(?)
RecursiveOwnedParameter 2011 2012 +0.1% 1.00x(?)
Integrate 247 247 +0.0% 1.00x
ClassArrayGetter 12 12 +0.0% 1.00x
DictionaryBridge 2780 2792 +0.4% 1.00x(?)
MonteCarloPi 42514 42342 -0.4% 1.00x
DictionarySwap 355 354 -0.3% 1.00x(?)
ArrayAppendToFromGeneric 563 563 +0.0% 1.00x
PopFrontArray 1058 1056 -0.2% 1.00x(?)
ArrayAppendASCII 18773 18837 +0.3% 1.00x(?)
Dictionary3OfObjects 908 912 +0.4% 1.00x(?)
StringHasPrefix 600 600 +0.0% 1.00x
ByteSwap 0 0 +0.0% 1.00x
ArrayAppendGenericStructs 1136 1136 +0.0% 1.00x
SuperChars 208429 208654 +0.1% 1.00x(?)
ArrayAppendLazyMap 860 862 +0.2% 1.00x(?)
ArrayPlusEqualFiveElementCollection 57424 57543 +0.2% 1.00x(?)
XorLoop 333 333 +0.0% 1.00x
ObserverClosure 2061 2062 +0.1% 1.00x(?)
AnyHashableWithAClass 58528 58470 -0.1% 1.00x(?)
CharacterLiteralsSmall 759 760 +0.1% 1.00x(?)
ObjectiveCBridgeStubToNSString 1446 1443 -0.2% 1.00x(?)
ArrayPlusEqualSingleElementCollection 54689 54792 +0.2% 1.00x(?)
ArrayAppendStrings 12284 12291 +0.1% 1.00x(?)
ObjectiveCBridgeStubFromNSStringRef 198 198 +0.0% 1.00x
ObjectiveCBridgeStubFromNSString 882 886 +0.5% 1.00x(?)
ProtocolDispatch 2859 2859 +0.0% 1.00x
TypeFlood 0 0 +0.0% 1.00x
StringHasSuffixUnicode 57871 57610 -0.5% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObject 59542 59527 -0.0% 1.00x(?)
ArrayLiteral 1338 1341 +0.2% 1.00x(?)
ArrayAppendLatin1 42268 42236 -0.1% 1.00x(?)
ArrayPlusEqualArrayOfInt 563 563 +0.0% 1.00x
Dictionary3 530 529 -0.2% 1.00x(?)
Dictionary2 1973 1974 +0.1% 1.00x(?)
StrComplexWalk 2798 2791 -0.2% 1.00x(?)
SetIntersect_OfObjects 1409 1409 +0.0% 1.00x
ErrorHandling 3053 3054 +0.0% 1.00x(?)
ArrayOfRef 3673 3678 +0.1% 1.00x(?)
ObserverUnappliedMethod 2511 2511 +0.0% 1.00x
ArrayAppendOptionals 1136 1136 +0.0% 1.00x
NSError 333 334 +0.3% 1.00x(?)
DictionaryOfObjects 2403 2405 +0.1% 1.00x(?)
ObjectiveCBridgeStubToNSDateRef 3177 3187 +0.3% 1.00x(?)
PopFrontArrayGeneric 1056 1056 +0.0% 1.00x
StringEqualPointerComparison 6915 6925 +0.1% 1.00x(?)
CaptureProp 763 763 +0.0% 1.00x
PolymorphicCalls 20 20 +0.0% 1.00x
ArrayAppendReserved 698 698 +0.0% 1.00x
ObjectiveCBridgeStubToNSStringRef 122 122 +0.0% 1.00x
ArrayAppendFromGeneric 563 563 +0.0% 1.00x
ObjectiveCBridgeStubDateMutation 257 257 +0.0% 1.00x
MapReduceSequence 576 578 +0.3% 1.00x(?)
MapReduceShort 2036 2041 +0.2% 1.00x(?)
ArrayAppendUTF16 39120 39148 +0.1% 1.00x(?)
IterateData 2526 2535 +0.4% 1.00x(?)
DictionaryLiteral 1402 1403 +0.1% 1.00x(?)
ArrayOfGenericPOD 207 207 +0.0% 1.00x
DictionaryRemoveOfObjects 20544 20571 +0.1% 1.00x(?)
UTF8Decode 264 264 +0.0% 1.00x
ObjectiveCBridgeStubURLAppendPath 202285 201536 -0.4% 1.00x(?)
MapReduceLazySequence 44 44 +0.0% 1.00x
171 2598341 2592581 -0.2% 1.00x
SetIsSubsetOf 234 234 +0.0% 1.00x
ObjectiveCBridgeStubToArrayOfNSString 26202 26198 -0.0% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObject 22246 22255 +0.0% 1.00x(?)
ObjectiveCBridgeStubDataAppend 3365 3373 +0.2% 1.00x(?)
NSDictionaryCastToSwift 5100 5125 +0.5% 1.00x(?)
ArrayOfGenericRef 3757 3768 +0.3% 1.00x(?)
ObjectiveCBridgeStubDateAccess 171 171 +0.0% 1.00x
Sim2DArray 260 260 +0.0% 1.00x
SetExclusiveOr_OfObjects 7159 7194 +0.5% 1.00x(?)
ArrayAppendRepeatCol 790 792 +0.2% 1.00x(?)
MapReduceShortString 19 19 +0.0% 1.00x
ObjectiveCBridgeToNSDictionary 55727 55813 +0.1% 1.00x(?)
MonteCarloE 9932 9925 -0.1% 1.00x(?)
SetUnion_OfObjects 5889 5902 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 67032 66710 -0.5% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
ArrayAppendToGeneric 563 563 +0.0% 1.00x
HashTest 1690 1693 +0.2% 1.00x(?)
SetIsSubsetOf_OfObjects 314 314 +0.0% 1.00x
ArrayAppend 931 930 -0.1% 1.00x(?)
LinkedList 7201 7200 -0.0% 1.00x(?)
NSStringConversion 695 694 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 3937 3956 +0.5% 1.00x(?)
ArrayAppendSequence 924 925 +0.1% 1.00x(?)
ArrayAppendArrayOfInt 563 563 +0.0% 1.00x
ArrayOfPOD 156 156 +0.0% 1.00x
MapReduceLazyCollection 84 84 +0.0% 1.00x
ObserverForwarderStruct 913 911 -0.2% 1.00x(?)
BitCount 1 1 +0.0% 1.00x
AngryPhonebook 2816 2822 +0.2% 1.00x(?)
SevenBoom 1401 1398 -0.2% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 67255 67198 -0.1% 1.00x(?)
StringWalk 5505 5505 +0.0% 1.00x
ArrayValueProp 5 5 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 50044 49971 -0.1% 1.00x(?)
Memset 221 221 +0.0% 1.00x
ArrayValueProp4 5 5 +0.0% 1.00x
TwoSum 1184 1188 +0.3% 1.00x(?)
ArrayValueProp2 5 5 +0.0% 1.00x
ArrayValueProp3 5 5 +0.0% 1.00x
ObjectiveCBridgeStubFromNSDate 3573 3563 -0.3% 1.00x(?)
ObserverPartiallyAppliedMethod 3592 3588 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 131522 133369 +1.4% 0.99x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 40744 41344 +1.5% 0.99x(?)
Histogram 237 239 +0.8% 0.99x(?)
ProtocolDispatch2 150 151 +0.7% 0.99x
ObjectiveCBridgeFromNSArrayAnyObjectForced 4162 4207 +1.1% 0.99x(?)
SortLettersInPlace 1036 1048 +1.2% 0.99x(?)
ObjectiveCBridgeToNSSet 34040 34286 +0.7% 0.99x(?)
ObjectiveCBridgeToNSArray 26825 26973 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 89924 91064 +1.3% 0.99x(?)
RGBHistogramOfObjects 21517 21654 +0.6% 0.99x(?)
ReversedBidirectional 45554 45858 +0.7% 0.99x(?)
DeadArray 171 173 +1.2% 0.99x
RC4 148 149 +0.7% 0.99x
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 4567 4670 +2.3% 0.98x(?)
ReversedArray 46 47 +2.2% 0.98x(?)
Prims 731 746 +2.0% 0.98x
ObjectiveCBridgeStubToNSDate 13666 13882 +1.6% 0.98x(?)
StaticArray 134 137 +2.2% 0.98x(?)
SortSortedStrings 786 805 +2.4% 0.98x
PopFrontUnsafePointer 8588 8740 +1.8% 0.98x(?)
SortStrings 1578 1629 +3.2% 0.97x
Calculator 30 31 +3.3% 0.97x
SetIntersect 301 309 +2.7% 0.97x
ArrayInClass 58 60 +3.5% 0.97x(?)
Walsh 302 313 +3.6% 0.96x
SortStringsUnicode 6819 7084 +3.9% 0.96x
RGBHistogram 2148 2247 +4.6% 0.96x
MapReduceLazyCollectionShort 57 60 +5.3% 0.95x
ObjectiveCBridgeStubNSDateMutationRef 11638 12225 +5.0% 0.95x(?)
**Unoptimized (Onone)**
Regression (2)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ObjectiveCBridgeStubDateMutation 429 457 +6.5% 0.94x
ReversedArray 464 492 +6.0% 0.94x
Improvement (2)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ArrayOfGenericPOD 3059 2890 -5.5% 1.06x(?)
OpenClose 523 433 -17.2% 1.21x
No Changes (168)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ArrayAppendReserved 3107 2950 -5.0% 1.05x
ProtocolDispatch 6292 6021 -4.3% 1.05x
RC4 6183 5953 -3.7% 1.04x(?)
ObjectiveCBridgeStubDateAccess 943 917 -2.8% 1.03x
ArrayAppendLatin1 97692 96008 -1.7% 1.02x
ArrayAppendASCII 78182 76374 -2.3% 1.02x
ErrorHandling 4026 3934 -2.3% 1.02x(?)
TypeFlood 159 156 -1.9% 1.02x(?)
ObserverUnappliedMethod 8013 7891 -1.5% 1.02x(?)
ArrayAppendUTF16 97535 95464 -2.1% 1.02x
ArrayAppendRepeatCol 173682 169636 -2.3% 1.02x(?)
BitCount 104 102 -1.9% 1.02x
DictionaryBridge 2936 2907 -1.0% 1.01x(?)
DictionarySwapOfObjects 18499 18231 -1.4% 1.01x(?)
DictionarySwap 5009 4958 -1.0% 1.01x
StrComplexWalk 8044 7968 -0.9% 1.01x(?)
ProtocolDispatch2 400 398 -0.5% 1.01x
SetIntersect_OfObjects 10478 10397 -0.8% 1.01x
ObjectiveCBridgeStubToNSStringRef 139 138 -0.7% 1.01x(?)
AngryPhonebook 2983 2959 -0.8% 1.01x(?)
IterateData 9698 9637 -0.6% 1.01x
DictionaryLiteral 11909 11797 -0.9% 1.01x(?)
Hanoi 15635 15461 -1.1% 1.01x(?)
SetExclusiveOr 19397 19290 -0.6% 1.01x(?)
NopDeinit 46050 45639 -0.9% 1.01x
SetIntersect 9927 9865 -0.6% 1.01x
ObjectiveCBridgeStubDataAppend 3618 3578 -1.1% 1.01x
ReversedBidirectional 118099 117127 -0.8% 1.01x(?)
StringHasPrefixUnicode 15019 14905 -0.8% 1.01x
MapReduceAnyCollection 33463 33211 -0.8% 1.01x(?)
MapReduce 33848 33632 -0.6% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 71158 70181 -1.4% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 80153 79662 -0.6% 1.01x(?)
ArrayAppendSequence 68237 67875 -0.5% 1.01x
SetUnion 10313 10205 -1.1% 1.01x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 69809 68851 -1.4% 1.01x(?)
ArrayValueProp 3232 3202 -0.9% 1.01x(?)
ArraySubscript 3759 3762 +0.1% 1.00x(?)
ObjectiveCBridgeToNSString 1262 1262 +0.0% 1.00x
MonteCarloPi 50585 50432 -0.3% 1.00x
RecursiveOwnedParameter 7699 7714 +0.2% 1.00x
ObjectiveCBridgeStubToNSString 1481 1484 +0.2% 1.00x(?)
ClassArrayGetter 812 812 +0.0% 1.00x
Array2D 525182 525269 +0.0% 1.00x(?)
Histogram 8063 8069 +0.1% 1.00x(?)
StringWithCString 301313 301392 +0.0% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 7302 7293 -0.1% 1.00x(?)
Prims 8048 8027 -0.3% 1.00x(?)
ObjectiveCBridgeFromNSString 3740 3739 -0.0% 1.00x(?)
ArrayAppendToFromGeneric 617 616 -0.2% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 113591 113724 +0.1% 1.00x(?)
Dictionary3OfObjects 1978 1979 +0.1% 1.00x(?)
RangeAssignment 5027 5028 +0.0% 1.00x(?)
ByteSwap 9 9 +0.0% 1.00x
ArrayAppendGenericStructs 1188 1189 +0.1% 1.00x(?)
SuperChars 255526 255566 +0.0% 1.00x(?)
ArrayAppendLazyMap 205071 204857 -0.1% 1.00x(?)
ArrayPlusEqualFiveElementCollection 231515 231822 +0.1% 1.00x(?)
XorLoop 18102 18100 -0.0% 1.00x(?)
ObserverClosure 6222 6233 +0.2% 1.00x(?)
CharacterLiteralsSmall 969 969 +0.0% 1.00x
Integrate 373 372 -0.3% 1.00x(?)
ArrayPlusEqualSingleElementCollection 228722 228666 -0.0% 1.00x(?)
ArrayAppendStrings 12264 12271 +0.1% 1.00x(?)
ObjectiveCBridgeStubFromNSString 902 902 +0.0% 1.00x
StaticArray 4312 4306 -0.1% 1.00x(?)
ObjectAllocation 611 609 -0.3% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObject 63033 63002 -0.1% 1.00x(?)
AnyHashableWithAClass 73627 73816 +0.3% 1.00x
Walsh 9695 9721 +0.3% 1.00x(?)
Dictionary3 1226 1226 +0.0% 1.00x
Join 1240 1245 +0.4% 1.00x(?)
ArrayOfRef 7908 7933 +0.3% 1.00x(?)
ObjectiveCBridgeStubURLAppendPathRef 207984 207577 -0.2% 1.00x(?)
ArrayAppendOptionals 1191 1190 -0.1% 1.00x(?)
ObjectiveCBridgeToNSArray 26644 26775 +0.5% 1.00x(?)
NSError 700 699 -0.1% 1.00x(?)
DictionaryOfObjects 4442 4432 -0.2% 1.00x(?)
ObjectiveCBridgeStubToNSDateRef 3231 3215 -0.5% 1.00x(?)
PopFrontUnsafePointer 151475 151796 +0.2% 1.00x
StringEqualPointerComparison 9058 9035 -0.2% 1.00x(?)
PolymorphicCalls 722 721 -0.1% 1.00x
ArrayAppendFromGeneric 615 615 +0.0% 1.00x
ArrayPlusEqualArrayOfInt 612 612 +0.0% 1.00x
MapReduceSequence 37503 37472 -0.1% 1.00x(?)
MapReduceShort 42340 42198 -0.3% 1.00x(?)
DictionaryRemoveOfObjects 48807 48751 -0.1% 1.00x(?)
171 5850143 5823267 -0.5% 1.00x
SetIsSubsetOf 1510 1506 -0.3% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObject 24380 24415 +0.1% 1.00x(?)
MapReduceClassShort 46100 45911 -0.4% 1.00x(?)
NSDictionaryCastToSwift 6300 6319 +0.3% 1.00x(?)
ObjectiveCBridgeStubNSDateRefAccess 1121 1116 -0.5% 1.00x
ArrayInClass 3607 3609 +0.1% 1.00x
ArrayOfGenericRef 8976 8987 +0.1% 1.00x(?)
StringHasSuffix 1487 1490 +0.2% 1.00x(?)
Sim2DArray 23595 23587 -0.0% 1.00x(?)
SetExclusiveOr_OfObjects 36927 36858 -0.2% 1.00x(?)
MonteCarloE 75244 75390 +0.2% 1.00x(?)
SetUnion_OfObjects 26281 26271 -0.0% 1.00x(?)
StringHasSuffixUnicode 59157 59192 +0.1% 1.00x(?)
ArrayAppendToGeneric 616 615 -0.2% 1.00x(?)
HashTest 5103 5106 +0.1% 1.00x(?)
SetIsSubsetOf_OfObjects 1462 1461 -0.1% 1.00x(?)
DictionaryRemove 17399 17368 -0.2% 1.00x(?)
LinkedList 27478 27465 -0.1% 1.00x(?)
NSStringConversion 1182 1181 -0.1% 1.00x(?)
MapReduceLazyCollection 29800 29907 +0.4% 1.00x(?)
ArrayAppendArrayOfInt 611 610 -0.2% 1.00x
Chars 6948 6934 -0.2% 1.00x(?)
RGBHistogram 29113 29257 +0.5% 1.00x(?)
StringBuilder 2717 2724 +0.3% 1.00x(?)
ObserverForwarderStruct 4261 4278 +0.4% 1.00x(?)
DeadArray 119602 119574 -0.0% 1.00x(?)
ArrayValueProp2 3719 3715 -0.1% 1.00x(?)
ArrayLiteral 1571 1571 +0.0% 1.00x
SevenBoom 1528 1526 -0.1% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 34541 34538 -0.0% 1.00x(?)
ArrayValueProp4 3413 3417 +0.1% 1.00x(?)
TwoSum 4307 4323 +0.4% 1.00x(?)
ArrayValueProp3 3588 3580 -0.2% 1.00x(?)
ObjectiveCBridgeStubFromNSDate 3614 3602 -0.3% 1.00x(?)
ObserverPartiallyAppliedMethod 7650 7677 +0.3% 1.00x(?)
StackPromo 91118 92310 +1.3% 0.99x(?)
PopFrontArray 8978 9101 +1.4% 0.99x
ObjectiveCBridgeStubFromNSDateRef 3662 3690 +0.8% 0.99x(?)
ReversedDictionary 21485 21721 +1.1% 0.99x(?)
MapReduceString 2057 2068 +0.5% 0.99x(?)
MapReduceLazyCollectionShort 37867 38123 +0.7% 0.99x(?)
StringInterpolation 14069 14142 +0.5% 0.99x(?)
CharacterLiteralsLarge 13223 13330 +0.8% 0.99x(?)
Dictionary2 3510 3533 +0.7% 0.99x(?)
PopFrontArrayGeneric 6701 6803 +1.5% 0.99x
CaptureProp 91981 93204 +1.3% 0.99x(?)
Calculator 979 989 +1.0% 0.99x
UTF8Decode 34123 34318 +0.6% 0.99x
MapReduceLazySequence 24752 24927 +0.7% 0.99x
Dictionary 1657 1672 +0.9% 0.99x
RGBHistogramOfObjects 79531 80114 +0.7% 0.99x(?)
MapReduceShortString 211 213 +0.9% 0.99x(?)
ObjectiveCBridgeToNSDictionary 56631 57204 +1.0% 0.99x(?)
StringWalk 20606 20919 +1.5% 0.99x
ObjectiveCBridgeStubFromArrayOfNSString 50309 50587 +0.6% 0.99x(?)
MapReduceClass 38343 38599 +0.7% 0.99x(?)
Dictionary2OfObjects 5721 5750 +0.5% 0.99x
ObjectiveCBridgeFromNSArrayAnyObjectToString 41629 42436 +1.9% 0.98x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 6926 7070 +2.1% 0.98x(?)
ObjectiveCBridgeFromNSStringForced 2504 2559 +2.2% 0.98x
SortLettersInPlace 2517 2566 +1.9% 0.98x
ObjectiveCBridgeToNSSet 34086 34879 +2.3% 0.98x(?)
ObjectiveCBridgeStubURLAppendPath 200573 203821 +1.6% 0.98x(?)
StrToInt 6803 6928 +1.8% 0.98x
ObjectiveCBridgeStubNSDateMutationRef 14327 14576 +1.7% 0.98x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 135873 139544 +2.7% 0.97x(?)
ObjectiveCBridgeStubToNSDate 13874 14338 +3.3% 0.97x(?)
SortStringsUnicode 8092 8360 +3.3% 0.97x
Phonebook 20335 20862 +2.6% 0.97x
ArrayAppend 3253 3345 +2.8% 0.97x
ObjectiveCBridgeFromNSSetAnyObjectForced 6614 6802 +2.8% 0.97x(?)
ArrayOfPOD 1729 1784 +3.2% 0.97x
SortStrings 2486 2588 +4.1% 0.96x
ObjectiveCBridgeStubFromNSStringRef 192 199 +3.6% 0.96x
StringHasPrefix 1545 1613 +4.4% 0.96x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 92256 95624 +3.6% 0.96x(?)
ObjectiveCBridgeStubToArrayOfNSString 26109 27257 +4.4% 0.96x
SortSortedStrings 1261 1326 +5.2% 0.95x
ObjectiveCBridgeStubNSDataAppend 2439 2565 +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

@codestergit
Copy link
Contributor Author

codestergit commented Feb 25, 2017

@airspeedswift
Why is linux test failing. Is it because of my changes or some other changes?

@codestergit
Copy link
Contributor Author

@dabrahams Updated the pull request to resolve conflicts.
The benchmark looks good. Can you please review and merge it.
Thanks

@natecook1000
Copy link
Member

@swift-ci Please smoke test

@dabrahams
Copy link
Contributor

@codestergit thanks for all your work on this!

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.