Skip to content

Enhance -assume-single-threaded option (SR-3945) #7557

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 16 commits into from
Feb 27, 2017

Conversation

mtake
Copy link
Contributor

@mtake mtake commented Feb 17, 2017

This PR is part of SR-3945 which extends the scope of -assume-single-threaded option to value types.

To create a special build of swift standard library and native runtime with non-atomic reference counting for single-threaded applications, pass -swift-stdlib-use-nonatomic-rc=true to build-script-impl.

To build your single-threaded application with non-atomic reference counting, pass -Xfrontend -assume-single-threaded to swift compiler.

(Note that this PR replaces #7421 in favor of not including unrelated merged commits from other people.)

@mtake
Copy link
Contributor Author

mtake commented Feb 17, 2017

@swiftix @gottesmm Please review

@mtake mtake changed the title Enhance -assume-single-threaded option (SR-3945) [WIP] Enhance -assume-single-threaded option (SR-3945) Feb 17, 2017
@slavapestov
Copy link
Contributor

To integrate the flag with the build system, you might want to take a look at how -enable-resilience is plumbed through; starting with the -swift-stdlib-enable-resilience=1 flag passed to build-script-impl.

@swiftix
Copy link
Contributor

swiftix commented Feb 17, 2017

@mtake Thanks for re-submitting this PR with only your changes!

Do you plan to integrate it with the build system by adding an option (e.g. -enable-assume-single-threaded) to the build script and adding a preset, so that it can be tested with the continuous build system?

bool AssumeSingleThreaded = false;
/// TODO: return to false when we pass "-Xfrontend -assume-single-threaded"
/// to swift compiler while building standard library.
bool AssumeSingleThreaded = std::getenv("SWIFT_ASSUME_SINGLE_THREADED");
Copy link
Contributor

Choose a reason for hiding this comment

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

It is a bit unorthodox to initialize the value of a compiler option from the environment variable. Once we have a better integration with the build system, we should better pass proper -assume-single-threaded options to the swift compiler rather than doing this trick.

Copy link
Contributor Author

@mtake mtake Feb 22, 2017

Choose a reason for hiding this comment

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

I added -swift-stdlib-use-nonatomic-rc option to build-script-impl in 102ee35. I will remove std::getenv once I confirm that the option has the same effect with it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed std::getenv in 8f8fd35. We can address the issue in a separate PR as needed.

@mtake
Copy link
Contributor Author

mtake commented Feb 18, 2017

@swiftix Although it is not integrated with the build system, I am testing with the environment variable set. As shown in FAIL.txt, some tests are failing and I think most if not all of them are testing race condition. I believe you have experienced the same problem when you introduced the -assume-single-threaded option for the first time. I am not familiar with build system, so please tell me if there is a way in the current test framework to exclude some tests depending on the build time option. If not, I ignore the failures.

@gottesmm
Copy link
Contributor

gottesmm commented Feb 20, 2017

@mtake What you want to do is add a flag to the build system. I would do this by looking at where resilience is added to the build system. Specifically if you look at line 269 in ./CMakeLists.txt, you will see:

option(SWIFT_STDLIB_ENABLE_RESILIENCE
           "Build the standard libraries and overlays with resilience enabled; see docs/LibraryEvolution.rst"
           FALSE)

I would copy that and add right beneath it a new option called:

option(SWIFT_STDLIB_USE_NONATOMIC_RC,
            "Build the standard libraries and overlays with nonatomic reference count operations enabled"
            FALSE)

And then edit test/lit.site.cfg.in and validation-test/lit.site.cfg.in and add a lit feature in both places for your cmake option. To add a lit feature, i.e. assuming the build system flag is SWIFT_STDLIB_USE_NONATOMIC_RC, you add some python code that looks like this:

if "@SWIFT_STDLIB_USE_NONATOMIC_RC@" == "TRUE":
    config.available_features.add("nonatomic_rc")
else:
    config.available_features.add("no_nonatomic_rc")

Then in each one of the tests that you want to disable when nonatomic_rc is enabled, you add in the file this:

// REQUIRES: no_nonatomic_rc

@gottesmm
Copy link
Contributor

@mtake If you are reading via email, I just updated my previous post with more comprehensive instructions. For some reason email doesn't mail out the updates. But I basically told you completely how to do it.

@swiftix
Copy link
Contributor

swiftix commented Feb 20, 2017

@mtake BTW, your PR needs to be rebased, because there is a conflict according to GitHub. To rebase and resolve the conflicts, use the following commands:
git fetch upstream master
git rebase upstream/master
You'll get some conflicts reported. Resolve them. And then:
git rebase --continue
git push --force

@mtake mtake force-pushed the enhance-assume-single-threaded branch from 166a492 to a93d595 Compare February 21, 2017 01:57
@mtake
Copy link
Contributor Author

mtake commented Feb 21, 2017

@gottesmm Thank you for the detailed instruction on how to add an option to build-script-impl! I just added -swift-stdlib-use-nonatomic-rc option and confirmed it works in many cases. However when I compare profiling results of swift benchmark suite with std::getenv and with the option, there are some difference. For example, following is the results of NSError.

With the option:

samples  %        image name               symbol name
48417    18.1543  libswiftCore.so          _swift_nonatomic_release_
39501    14.8112  libswiftCore.so          _swift_retain_
30161    11.3091  libswiftCore.so          _swift_release_
23992     8.9960  libswiftCore.so          swift_deallocClassInstance
22474     8.4268  libc-2.24.so             _int_malloc
22468     8.4245  libFoundation.so         Foundation.NSError.__allocating_init (domain : Swift.String, code : Swift.Int, userInfo : [Swift.String : Any]?) -> Foundation.NSError
19135     7.1748  libc-2.24.so             malloc
18236     6.8377  libc-2.24.so             _int_free
7310      2.7409  libc-2.24.so             free
6041      2.2651  libFoundation.so         Foundation.NSError.__deallocating_deinit
4799      1.7994  libswiftCore.so          swift_initStackObject
4452      1.6693  libswiftCore.so          _swift_release_dealloc
4404      1.6513  libswiftCore.so          _swift_allocObject_
3999      1.4995  libFoundation.so         swift_rt_swift_release
3217      1.2062  libFoundation.so         Foundation.NSObject.init () -> Foundation.NSObject

With std::getenv:

samples  %        image name               symbol name
72819    28.7049  libswiftCore.so          _swift_nonatomic_release_
30200    11.9047  libswiftCore.so          swift_deallocClassInstance
26814    10.5700  libFoundation.so         Foundation.NSError.__allocating_init (domain : Swift.String, code : Swift.Int, userInfo : [Swift.String : Any]?) -> Foundation.NSError
24037     9.4753  libc-2.24.so             _int_free
23860     9.4055  libc-2.24.so             _int_malloc
18057     7.1180  libc-2.24.so             malloc
9687      3.8186  libc-2.24.so             free
8581      3.3826  libFoundation.so         Foundation.NSError.__deallocating_deinit
5813      2.2915  libswiftCore.so          _swift_nonatomic_retain_
5652      2.2280  libswiftCore.so          _swift_release_dealloc
5571      2.1961  libswiftCore.so          _swift_allocObject_
5513      2.1732  libswiftCore.so          swift_initStackObject
4188      1.6509  libFoundation.so         swift_rt_swift_nonatomic_release
3322      1.3095  libFoundation.so         Foundation.NSObject.init () -> Foundation.NSObject
2800      1.1037  libFoundation.so         Foundation.NSObject.deinit

It looks like, for some type of swift code, the option doesn't pass -Xfrontend -assume-single-threaded flags to the swift compiler or they are not effective.

Do you have any idea about it?

@gottesmm
Copy link
Contributor

gottesmm commented Feb 22, 2017

@mtake I was talking with @jrose-apple today.

He mentioned to me that lit supports the UNSUPPORTED check. With that you can get rid of the no_nonatomic_rc flag. So in other words, make this change:

if "@SWIFT_STDLIB_USE_NONATOMIC_RC@" == "TRUE":
    config.available_features.add("nonatomic_rc")
# Notice no config.available_features.add("no_nonatomic_rc")
// UNSUPPORTED: nonatomic_rc

@@ -188,6 +189,7 @@ template <class Impl, class T> struct RetainableBoxBase {
static constexpr size_t stride = sizeof(T);
static constexpr bool isPOD = false;
static constexpr bool isBitwiseTakable = true;
static const bool isAtomic;
Copy link
Contributor

Choose a reason for hiding this comment

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

This will impose a cost for normal atomic code. Can you instead either use a cpp flag or us a constexpr that is set by a cpp flag. In the later case, the optimizer should be able to completely eliminate the false path but limit the amount of places the preprocessor code will touch. Your choice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in dfbdf00

@@ -471,6 +512,19 @@ class WeakRefCount {
return (oldval & RC_COUNT_MASK) == subval;
}

/// Decrement the weak reference count.
/// Return true if the caller should deallocate the object.
bool decrementShouldDeallocateNNNonAtomic(uint32_t n) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the name here have 2 ns? (i.e. decrementShouldDeallocateNNonAtomic).

Copy link
Contributor Author

@mtake mtake Feb 22, 2017

Choose a reason for hiding this comment

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

Fixed in 3c03c96

@gottesmm
Copy link
Contributor

@mtake I think the issue is that you probably need to thread the option through to the benchmark suite. It uses different cmake code. Give me a second to refresh my memory.

@gottesmm
Copy link
Contributor

@mtake This is one reason why I wish that the benchmark suite was separate from the main repo and used its own cmake stuff sigh. The hacky way to do this is to go to: AddSwiftBenchmarkSuite.cmake. Do a check if that cmake flag is set and if so, add your flag to both common_options and common_driver_options. It is a bit of a hack, but most of that code is a hack anyways...

@mtake
Copy link
Contributor Author

mtake commented Feb 22, 2017

@gottesmm I am running benchmark on Linux. Since the benchmark doesn't compile on Linux, building Swift on Linux doesn't build the benchmark. I apply my local patch to the benchmark then build it with my shell script which is independent from the existing build mechanism for the benchmark. Details are described in https://github.com/mtake/swift-for-linux/blob/master/README-benchmark.txt. Anyway I wonder that there is a case (presumably related to -wmo) in the current swift compiler where a different instance of SILOptions is created and used without parsing arguments.

@mtake mtake changed the title [WIP] Enhance -assume-single-threaded option (SR-3945) Enhance -assume-single-threaded option (SR-3945) Feb 22, 2017
@mtake
Copy link
Contributor Author

mtake commented Feb 22, 2017

@gottesmm @swiftix Please review

I addressed all your comments. An unresolved issue remains, but we can address it later in a separate PR.

@swiftix
Copy link
Contributor

swiftix commented Feb 22, 2017

@swift-ci please test with buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx,single-thread

@swiftix
Copy link
Contributor

swiftix commented Feb 22, 2017

preset=buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx,single-thread
@swift-ci Please test macOS with preset

@swiftix
Copy link
Contributor

swiftix commented Feb 22, 2017

preset=buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx,single-thread
@swift-ci please test macOS with preset

@swiftix
Copy link
Contributor

swiftix commented Feb 22, 2017

preset=buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx,single-thread
@swift-ci please test with preset

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test macOS with preset
Git Commit - 166a492709a67272dbf04dbd87d6c6e08bc36a9e
Test requested by - @swiftix

@swiftix
Copy link
Contributor

swiftix commented Feb 22, 2017

@mtake I've run your PR using the commands you can see above. It was running on our internal bots. Overall it look good and breaks only one of our internal tests, which probably needs to be updated.

But it is impossible at the moment to benchmark your PR on our CI, because it does not support custom presets yet.

Question: Have you benchmarked your latest version locally? Does it remove all the atomic ref-counting operations as good as it did before the changes related to the integration with the build system? I.e. is using of the your new build-system flag leads to expected results or do you see that some atomic reference counting operations are not removed yet, though they should be?


# Don't build the benchmarks
skip-build-benchmarks

Copy link
Contributor

Choose a reason for hiding this comment

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

@mtake You don't need an incremental build I guess. I think it could be shorter and more future proof to take preset: buildbot,tools=RA,stdlib=RD (based on mixin_buildbot_tools_RA_stdlib_RD ) as a starting point and slightly change it:

[preset: buildbot,tools=RA,stdlib=RD,single-thread]
mixin-preset=mixin_buildbot_tools_RA_stdlib_RD

build-subdir=buildbot_single_thread

dash-dash

# Enable non-atomic build of the stdlib
swift-stdlib-use-nonatomic-rc=true

# Don't run host tests for iOS, tvOS and watchOS platforms to make the build
# faster.
skip-test-ios-host
skip-test-tvos-host
skip-test-watchos-host

This way you don't need to repeat a lot of options. You also do not exclude the build of benchmarks.

@gottesmm What do you think? Does it make sense to take mixin_buildbot_tools_RA_stdlib_RD as a basis preset? Or should it be something else?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm... If it is for benchmarking, then use stdlib_RD, if you want to use it for correctness, you probably want stdlib_RDA so you have asserts.

Copy link
Contributor

Choose a reason for hiding this comment

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

*or you could even use stdlib_R if you want.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, since this preset for benchmarking purposes, we probably don't even need the debug info emission for the stdlib, as it only increases the build time.
So, one could even add:
swift-stdlib-build-type=Release after dash-dash

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 68c4bd1.

@mtake
Copy link
Contributor Author

mtake commented Feb 24, 2017

@swiftix Results with the new build-system flag (buildpreset only) are close to the results with the old build-system flag (buildpreset and envvar), but there are measurable difference in a few tests. If you compare ChartByARC graph, you will see the difference in SevenBoom, NSError and IterateData. Raw profiling data show high percentage for Foundation.NSError.(__allocating_init|__deallocating_deinit) in SevenBoom and NSError, and Foundation._NSRange.init in IterateData. There are no other tests that show high percentage for the methods, so the anomalies may be related to how they were compiled. Note that in the graph ".*swift_(release(?!_dealloc).*|retain.*)" and ".*swift_nonatomic_(release|retain).*" are considered as atomic and nonatomic RC, respectively. Other variations are unclassified and mixed in libswiftCore(others). Since we can address the anomalies and extend the scope for other variations in the future PRs, I think this is ready to be merged.

For your reference, the graph with default build (atomic) is also attached.

@swiftix
Copy link
Contributor

swiftix commented Feb 24, 2017

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 166a492709a67272dbf04dbd87d6c6e08bc36a9e
Test requested by - @swiftix

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 166a492709a67272dbf04dbd87d6c6e08bc36a9e
Test requested by - @swiftix

@swiftix
Copy link
Contributor

swiftix commented Feb 24, 2017

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (0)
Improvement (1)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StringWithCString 199148 154744 -22.3% 1.29x
No Changes (171)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StringHasSuffix 720 687 -4.6% 1.05x(?)
StaticArray 130 125 -3.9% 1.04x(?)
ObjectiveCBridgeFromNSStringForced 2220 2162 -2.6% 1.03x(?)
StrToInt 5979 5790 -3.2% 1.03x(?)
ObjectiveCBridgeStubToNSDate 13878 13597 -2.0% 1.02x(?)
ObjectiveCBridgeToNSArray 26758 26325 -1.6% 1.02x(?)
171 2662792 2618345 -1.7% 1.02x
NSDictionaryCastToSwift 5138 5041 -1.9% 1.02x(?)
ArrayInClass 59 58 -1.7% 1.02x(?)
ObjectiveCBridgeFromNSString 1342 1321 -1.6% 1.02x(?)
StringHasPrefixUnicode 13427 13212 -1.6% 1.02x
ArraySubscript 1453 1433 -1.4% 1.01x(?)
Prims 733 727 -0.8% 1.01x(?)
MapReduceString 77 76 -1.3% 1.01x(?)
RangeAssignment 303 300 -1.0% 1.01x(?)
StringInterpolation 8907 8846 -0.7% 1.01x(?)
ObjectiveCBridgeStubToNSDateRef 3178 3152 -0.8% 1.01x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 90441 89836 -0.7% 1.01x(?)
ObjectiveCBridgeFromNSArrayAnyObject 22242 22042 -0.9% 1.01x(?)
SetUnion_OfObjects 5911 5865 -0.8% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 67170 66513 -1.0% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 75006 74494 -0.7% 1.01x(?)
ObjectiveCBridgeStubNSDataAppend 2200 2180 -0.9% 1.01x(?)
ObjectiveCBridgeToNSString 1218 1221 +0.2% 1.00x(?)
DictionarySwapOfObjects 6564 6545 -0.3% 1.00x(?)
StackPromo 21452 21441 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 109619 110079 +0.4% 1.00x(?)
RecursiveOwnedParameter 2010 2011 +0.1% 1.00x(?)
Integrate 248 247 -0.4% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 131324 131544 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 40625 40728 +0.2% 1.00x(?)
ClassArrayGetter 12 12 +0.0% 1.00x
Histogram 230 230 +0.0% 1.00x
SortStrings 1579 1586 +0.4% 1.00x(?)
ProtocolDispatch2 150 150 +0.0% 1.00x
ObjectiveCBridgeStubFromNSDateRef 3643 3656 +0.4% 1.00x(?)
MonteCarloPi 42517 42526 +0.0% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 4189 4187 -0.1% 1.00x(?)
SortLettersInPlace 1032 1031 -0.1% 1.00x(?)
DictionarySwap 354 354 +0.0% 1.00x
ArrayAppendToFromGeneric 563 563 +0.0% 1.00x
PopFrontArray 1057 1057 +0.0% 1.00x
ArrayAppendASCII 18774 18773 -0.0% 1.00x(?)
MapReduceLazyCollectionShort 57 57 +0.0% 1.00x
StringHasPrefix 600 600 +0.0% 1.00x
ByteSwap 0 0 +0.0% 1.00x
ArrayAppendGenericStructs 1136 1137 +0.1% 1.00x(?)
SuperChars 210031 210627 +0.3% 1.00x(?)
ArrayAppendLazyMap 862 859 -0.3% 1.00x(?)
XorLoop 333 333 +0.0% 1.00x
ArrayAppendReserved 698 698 +0.0% 1.00x
ObserverClosure 2077 2076 -0.1% 1.00x(?)
AnyHashableWithAClass 58125 58109 -0.0% 1.00x(?)
CharacterLiteralsSmall 759 759 +0.0% 1.00x
ObjectiveCBridgeStubToNSString 1441 1439 -0.1% 1.00x(?)
ArrayPlusEqualSingleElementCollection 54926 55019 +0.2% 1.00x(?)
ArrayAppendStrings 12282 12303 +0.2% 1.00x(?)
Join 469 469 +0.0% 1.00x
ObjectiveCBridgeStubFromNSStringRef 198 198 +0.0% 1.00x
ProtocolDispatch 2859 2859 +0.0% 1.00x
ObjectAllocation 169 169 +0.0% 1.00x
TypeFlood 0 0 +0.0% 1.00x
SortSortedStrings 787 788 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObject 59648 59529 -0.2% 1.00x(?)
ArrayLiteral 1328 1333 +0.4% 1.00x
ArrayAppendLatin1 42269 42273 +0.0% 1.00x(?)
CharacterLiteralsLarge 11662 11618 -0.4% 1.00x(?)
Walsh 302 301 -0.3% 1.00x(?)
Dictionary3 530 531 +0.2% 1.00x(?)
Dictionary2 1974 1975 +0.1% 1.00x(?)
StrComplexWalk 2796 2808 +0.4% 1.00x(?)
SetIntersect_OfObjects 1412 1411 -0.1% 1.00x(?)
ErrorHandling 3067 3068 +0.0% 1.00x(?)
ArrayOfRef 3679 3682 +0.1% 1.00x(?)
ObserverUnappliedMethod 2511 2511 +0.0% 1.00x
ObjectiveCBridgeStubURLAppendPathRef 198964 199048 +0.0% 1.00x(?)
ArrayAppendOptionals 1136 1136 +0.0% 1.00x
NSError 333 334 +0.3% 1.00x(?)
DictionaryOfObjects 2399 2398 -0.0% 1.00x(?)
PopFrontArrayGeneric 1057 1057 +0.0% 1.00x
StringEqualPointerComparison 6915 6913 -0.0% 1.00x(?)
CaptureProp 763 763 +0.0% 1.00x
PolymorphicCalls 20 20 +0.0% 1.00x
RC4 148 148 +0.0% 1.00x
ObjectiveCBridgeStubToNSStringRef 122 122 +0.0% 1.00x
Calculator 30 30 +0.0% 1.00x
ArrayAppendFromGeneric 563 563 +0.0% 1.00x
MapReduce 350 351 +0.3% 1.00x(?)
MapReduceSequence 578 576 -0.3% 1.00x(?)
MapReduceShort 2003 2005 +0.1% 1.00x(?)
ObjectiveCBridgeStubDateMutation 257 257 +0.0% 1.00x
ArrayAppendUTF16 39118 39121 +0.0% 1.00x(?)
IterateData 2525 2530 +0.2% 1.00x(?)
DictionaryLiteral 1392 1396 +0.3% 1.00x(?)
Hanoi 3290 3278 -0.4% 1.00x(?)
OpenClose 48 48 +0.0% 1.00x
DictionaryRemoveOfObjects 20499 20498 -0.0% 1.00x(?)
UTF8Decode 264 264 +0.0% 1.00x
ObjectiveCBridgeStubURLAppendPath 200440 200406 -0.0% 1.00x(?)
MapReduceLazySequence 44 44 +0.0% 1.00x
SetExclusiveOr 2354 2352 -0.1% 1.00x(?)
SetIsSubsetOf 234 234 +0.0% 1.00x
Dictionary 741 742 +0.1% 1.00x(?)
NopDeinit 20171 20166 -0.0% 1.00x(?)
SetIntersect 301 302 +0.3% 1.00x(?)
ObjectiveCBridgeStubDataAppend 3344 3344 +0.0% 1.00x
MapReduceClassShort 4570 4564 -0.1% 1.00x(?)
RGBHistogramOfObjects 21665 21739 +0.3% 1.00x(?)
ObjectiveCBridgeStubNSDateRefAccess 323 323 +0.0% 1.00x
StringBuilder 1288 1284 -0.3% 1.00x(?)
ArrayOfGenericPOD 207 207 +0.0% 1.00x
ArrayOfGenericRef 3772 3776 +0.1% 1.00x(?)
Phonebook 6981 6981 +0.0% 1.00x
ObjectiveCBridgeStubDateAccess 171 171 +0.0% 1.00x
Sim2DArray 260 260 +0.0% 1.00x
SetExclusiveOr_OfObjects 7126 7117 -0.1% 1.00x(?)
ArrayAppendRepeatCol 791 791 +0.0% 1.00x
MapReduceShortString 19 19 +0.0% 1.00x
ObjectiveCBridgeToNSDictionary 56280 56526 +0.4% 1.00x(?)
MonteCarloE 9933 9931 -0.0% 1.00x(?)
StringHasSuffixUnicode 57857 57724 -0.2% 1.00x(?)
ArrayAppendToGeneric 564 564 +0.0% 1.00x
HashTest 1699 1701 +0.1% 1.00x(?)
SetIsSubsetOf_OfObjects 314 314 +0.0% 1.00x
ArrayAppend 931 931 +0.0% 1.00x
DictionaryRemove 3091 3090 -0.0% 1.00x(?)
LinkedList 7223 7227 +0.1% 1.00x(?)
MapReduceAnyCollection 352 353 +0.3% 1.00x(?)
ReversedBidirectional 46003 46203 +0.4% 1.00x(?)
NSStringConversion 693 696 +0.4% 1.00x(?)
ArrayAppendSequence 925 925 +0.0% 1.00x
ArrayAppendArrayOfInt 563 563 +0.0% 1.00x
ArrayOfPOD 156 156 +0.0% 1.00x
SetUnion 1887 1891 +0.2% 1.00x(?)
Chars 1382 1382 +0.0% 1.00x
MapReduceLazyCollection 84 84 +0.0% 1.00x
ReversedArray 46 46 +0.0% 1.00x
ObserverForwarderStruct 911 912 +0.1% 1.00x(?)
DeadArray 171 171 +0.0% 1.00x
BitCount 1 1 +0.0% 1.00x
AngryPhonebook 2829 2831 +0.1% 1.00x(?)
ArrayPlusEqualArrayOfInt 563 563 +0.0% 1.00x
SevenBoom 1392 1394 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 67406 67677 +0.4% 1.00x(?)
StringWalk 5837 5837 +0.0% 1.00x
ArrayValueProp 5 5 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 49868 50046 +0.4% 1.00x(?)
MapReduceClass 2959 2962 +0.1% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 221 221 +0.0% 1.00x
Dictionary2OfObjects 3430 3446 +0.5% 1.00x(?)
ArrayValueProp4 5 5 +0.0% 1.00x
ArrayValueProp2 5 5 +0.0% 1.00x
ArrayValueProp3 5 5 +0.0% 1.00x
ObjectiveCBridgeStubFromNSDate 3586 3579 -0.2% 1.00x(?)
ObserverPartiallyAppliedMethod 3655 3654 -0.0% 1.00x(?)
Array2D 1832 1850 +1.0% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 4567 4622 +1.2% 0.99x(?)
ReversedDictionary 84 85 +1.2% 0.99x(?)
Dictionary3OfObjects 907 917 +1.1% 0.99x(?)
ArrayPlusEqualFiveElementCollection 57340 57739 +0.7% 0.99x(?)
ObjectiveCBridgeToNSSet 34074 34282 +0.6% 0.99x(?)
PopFrontUnsafePointer 8596 8702 +1.2% 0.99x(?)
SortStringsUnicode 6814 6893 +1.2% 0.99x
ObjectiveCBridgeStubToArrayOfNSString 25933 26115 +0.7% 0.99x(?)
RGBHistogram 2148 2159 +0.5% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 3943 3976 +0.8% 0.99x(?)
ObjectiveCBridgeStubNSDateMutationRef 12134 12281 +1.2% 0.99x(?)
TwoSum 1181 1187 +0.5% 0.99x(?)
ObjectiveCBridgeStubFromNSString 883 898 +1.7% 0.98x(?)
DictionaryBridge 2754 2839 +3.1% 0.97x(?)
**Unoptimized (Onone)**
Regression (0)
Improvement (2)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
NopDeinit 47411 43221 -8.8% 1.10x
OpenClose 476 419 -12.0% 1.14x(?)
No Changes (170)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ArrayAppendLatin1 98130 94982 -3.2% 1.03x
ArrayAppendASCII 78133 75553 -3.3% 1.03x
ArrayAppendUTF16 97576 94818 -2.8% 1.03x
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 71977 69884 -2.9% 1.03x(?)
Histogram 8029 7887 -1.8% 1.02x(?)
DictionarySwap 4888 4814 -1.5% 1.02x
ObjectiveCBridgeStubToNSString 1529 1493 -2.4% 1.02x(?)
ObjectiveCBridgeStubURLAppendPath 205191 200450 -2.3% 1.02x(?)
ObjectiveCBridgeStubNSDataAppend 2493 2436 -2.3% 1.02x(?)
StackPromo 92445 91423 -1.1% 1.01x(?)
DictionarySwapOfObjects 18324 18206 -0.6% 1.01x(?)
StrComplexWalk 8070 7996 -0.9% 1.01x(?)
ArrayAppendLazyMap 207351 205877 -0.7% 1.01x
ObjectiveCBridgeStubToNSDate 14387 14269 -0.8% 1.01x(?)
StringInterpolation 14058 13966 -0.7% 1.01x(?)
CharacterLiteralsLarge 13245 13153 -0.7% 1.01x
ArrayPlusEqualSingleElementCollection 228450 226865 -0.7% 1.01x(?)
Join 1241 1233 -0.6% 1.01x
StringHasSuffixUnicode 59185 58802 -0.7% 1.01x
ObjectiveCBridgeStubURLAppendPathRef 207197 205357 -0.9% 1.01x(?)
DictionaryOfObjects 4499 4442 -1.3% 1.01x
MapReduceShort 42753 42483 -0.6% 1.01x(?)
Hanoi 15773 15559 -1.4% 1.01x
171 5876486 5831874 -0.8% 1.01x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 93314 92254 -1.1% 1.01x(?)
ObjectiveCBridgeStubDataAppend 3596 3564 -0.9% 1.01x(?)
NSDictionaryCastToSwift 6314 6255 -0.9% 1.01x(?)
StringHasPrefixUnicode 15008 14822 -1.2% 1.01x
ObjectiveCBridgeFromNSSetAnyObjectToString 79943 79244 -0.9% 1.01x(?)
NSStringConversion 1202 1192 -0.8% 1.01x
ObjectiveCBridgeFromNSSetAnyObjectForced 6679 6635 -0.7% 1.01x(?)
ArrayAppendSequence 67797 67051 -1.1% 1.01x
RGBHistogram 28991 28819 -0.6% 1.01x(?)
BitCount 104 103 -1.0% 1.01x
ArraySubscript 3759 3756 -0.1% 1.00x(?)
ObjectiveCBridgeToNSString 1265 1264 -0.1% 1.00x
MonteCarloPi 50565 50551 -0.0% 1.00x(?)
RecursiveOwnedParameter 7680 7684 +0.1% 1.00x(?)
Integrate 376 377 +0.3% 1.00x
ObjectiveCBridgeFromNSArrayAnyObjectToString 42042 42133 +0.2% 1.00x(?)
ClassArrayGetter 811 812 +0.1% 1.00x
Array2D 524662 525350 +0.1% 1.00x(?)
SortStrings 2460 2467 +0.3% 1.00x(?)
ObjectiveCBridgeStubFromNSDateRef 3660 3661 +0.0% 1.00x(?)
StringWithCString 301397 301335 -0.0% 1.00x(?)
ObjectiveCBridgeFromNSStringForced 2506 2511 +0.2% 1.00x(?)
Prims 8108 8088 -0.2% 1.00x(?)
ReversedDictionary 21563 21622 +0.3% 1.00x(?)
ArrayAppendToFromGeneric 614 613 -0.2% 1.00x
MapReduceString 2040 2038 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 113059 113154 +0.1% 1.00x(?)
Dictionary3OfObjects 1989 1989 +0.0% 1.00x
RangeAssignment 5020 5011 -0.2% 1.00x(?)
MapReduceLazyCollectionShort 39226 39220 -0.0% 1.00x(?)
ByteSwap 9 9 +0.0% 1.00x
ArrayAppendGenericStructs 1189 1189 +0.0% 1.00x
SuperChars 255491 254739 -0.3% 1.00x(?)
ArrayPlusEqualFiveElementCollection 230359 230406 +0.0% 1.00x(?)
XorLoop 18095 18093 -0.0% 1.00x(?)
AnyHashableWithAClass 73622 73714 +0.1% 1.00x(?)
CharacterLiteralsSmall 969 969 +0.0% 1.00x
ArrayAppendStrings 12273 12275 +0.0% 1.00x(?)
ObjectiveCBridgeStubFromNSStringRef 192 192 +0.0% 1.00x
ProtocolDispatch 6292 6292 +0.0% 1.00x
ObjectAllocation 606 606 +0.0% 1.00x
TypeFlood 159 159 +0.0% 1.00x
SortSortedStrings 1249 1250 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSSetAnyObject 62842 63123 +0.5% 1.00x(?)
ArrayLiteral 1574 1580 +0.4% 1.00x(?)
ProtocolDispatch2 401 401 +0.0% 1.00x
ArrayPlusEqualArrayOfInt 613 611 -0.3% 1.00x(?)
Walsh 9666 9701 +0.4% 1.00x
Dictionary3 1231 1233 +0.2% 1.00x(?)
Dictionary2 3503 3499 -0.1% 1.00x(?)
StringHasPrefix 1546 1546 +0.0% 1.00x
SetIntersect_OfObjects 10325 10354 +0.3% 1.00x
ErrorHandling 3931 3942 +0.3% 1.00x(?)
ArrayOfRef 7921 7897 -0.3% 1.00x(?)
ObserverUnappliedMethod 7834 7825 -0.1% 1.00x(?)
ArrayAppendOptionals 1190 1193 +0.2% 1.00x
NSError 697 696 -0.1% 1.00x(?)
ObjectiveCBridgeStubToNSDateRef 3214 3212 -0.1% 1.00x(?)
PopFrontUnsafePointer 151431 151411 -0.0% 1.00x(?)
StringEqualPointerComparison 9048 9018 -0.3% 1.00x(?)
CaptureProp 93382 93105 -0.3% 1.00x
PolymorphicCalls 721 721 +0.0% 1.00x
ArrayAppendReserved 3106 3105 -0.0% 1.00x(?)
ObjectiveCBridgeStubToNSStringRef 139 139 +0.0% 1.00x
Calculator 978 977 -0.1% 1.00x(?)
ArrayAppendFromGeneric 614 615 +0.2% 1.00x(?)
MapReduce 33336 33284 -0.2% 1.00x(?)
MapReduceSequence 37318 37146 -0.5% 1.00x
ObjectiveCBridgeStubDateMutation 429 429 +0.0% 1.00x
IterateData 9683 9706 +0.2% 1.00x(?)
DictionaryLiteral 11655 11626 -0.2% 1.00x(?)
ArrayOfGenericPOD 3059 3063 +0.1% 1.00x(?)
DictionaryRemoveOfObjects 49287 49450 +0.3% 1.00x(?)
UTF8Decode 34195 34220 +0.1% 1.00x(?)
SortStringsUnicode 8074 8043 -0.4% 1.00x
MapReduceLazySequence 24533 24583 +0.2% 1.00x
SetExclusiveOr 18915 18882 -0.2% 1.00x(?)
SetIsSubsetOf 1501 1497 -0.3% 1.00x(?)
ObjectiveCBridgeStubToArrayOfNSString 26288 26283 -0.0% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObject 23632 23575 -0.2% 1.00x(?)
SetIntersect 9854 9848 -0.1% 1.00x(?)
RGBHistogramOfObjects 79713 79944 +0.3% 1.00x(?)
ObjectiveCBridgeStubNSDateRefAccess 1124 1127 +0.3% 1.00x(?)
StrToInt 6817 6835 +0.3% 1.00x(?)
ArrayInClass 3607 3608 +0.0% 1.00x(?)
ArrayOfGenericRef 8986 8959 -0.3% 1.00x(?)
ObjectiveCBridgeStubDateAccess 944 943 -0.1% 1.00x
Sim2DArray 23602 23600 -0.0% 1.00x(?)
SetExclusiveOr_OfObjects 36784 36811 +0.1% 1.00x(?)
MapReduceShortString 207 207 +0.0% 1.00x
MonteCarloE 75523 75561 +0.1% 1.00x(?)
SetUnion_OfObjects 26180 26159 -0.1% 1.00x(?)
ObjectiveCBridgeStubNSDateMutationRef 14907 14966 +0.4% 1.00x(?)
RC4 5813 5798 -0.3% 1.00x(?)
ArrayAppendToGeneric 616 615 -0.2% 1.00x
HashTest 5110 5108 -0.0% 1.00x(?)
SetIsSubsetOf_OfObjects 1453 1456 +0.2% 1.00x(?)
ArrayAppend 3251 3250 -0.0% 1.00x(?)
DictionaryRemove 16634 16565 -0.4% 1.00x(?)
LinkedList 27404 27409 +0.0% 1.00x(?)
MapReduceAnyCollection 33085 33032 -0.2% 1.00x(?)
ReversedBidirectional 116533 116246 -0.2% 1.00x(?)
MapReduceLazyCollection 29689 29732 +0.1% 1.00x
ArrayAppendArrayOfInt 610 610 +0.0% 1.00x
ArrayOfPOD 1728 1728 +0.0% 1.00x
SetUnion 10271 10288 +0.2% 1.00x(?)
Chars 6934 6942 +0.1% 1.00x(?)
ReversedArray 464 464 +0.0% 1.00x
StringBuilder 2698 2695 -0.1% 1.00x(?)
ObserverForwarderStruct 4171 4165 -0.1% 1.00x(?)
DeadArray 120730 120564 -0.1% 1.00x(?)
AngryPhonebook 2963 2960 -0.1% 1.00x(?)
SevenBoom 1530 1529 -0.1% 1.00x(?)
ArrayValueProp 3187 3194 +0.2% 1.00x(?)
ObjectiveCBridgeStubFromArrayOfNSString 50126 50336 +0.4% 1.00x(?)
MapReduceClass 37792 37742 -0.1% 1.00x(?)
StringHasSuffix 1487 1487 +0.0% 1.00x
GlobalClass 0 0 +0.0% 1.00x
Memset 34536 34545 +0.0% 1.00x(?)
Dictionary2OfObjects 5725 5708 -0.3% 1.00x(?)
ArrayValueProp4 3418 3415 -0.1% 1.00x(?)
TwoSum 4283 4266 -0.4% 1.00x(?)
ArrayValueProp2 3700 3707 +0.2% 1.00x(?)
ArrayValueProp3 3488 3494 +0.2% 1.00x(?)
ObjectiveCBridgeStubFromNSDate 3609 3618 +0.2% 1.00x(?)
ObserverPartiallyAppliedMethod 7621 7598 -0.3% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 135867 136611 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 7219 7287 +0.9% 0.99x(?)
SortLettersInPlace 2494 2509 +0.6% 0.99x(?)
ObserverClosure 6178 6263 +1.4% 0.99x
StaticArray 4310 4356 +1.1% 0.99x
ObjectiveCBridgeToNSSet 34070 34441 +1.1% 0.99x(?)
ObjectiveCBridgeToNSArray 26484 26641 +0.6% 0.99x(?)
PopFrontArrayGeneric 6490 6571 +1.2% 0.99x
Dictionary 1655 1665 +0.6% 0.99x(?)
MapReduceClassShort 46989 47343 +0.8% 0.99x(?)
ObjectiveCBridgeFromNSString 3732 3755 +0.6% 0.99x(?)
ArrayAppendRepeatCol 168978 170162 +0.7% 0.99x
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 68095 68623 +0.8% 0.99x(?)
PopFrontArray 8919 9069 +1.7% 0.98x
DictionaryBridge 2818 2885 +2.4% 0.98x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 6862 7027 +2.4% 0.98x(?)
ObjectiveCBridgeStubFromNSString 895 915 +2.2% 0.98x
StringWalk 20497 20838 +1.7% 0.98x
ObjectiveCBridgeToNSDictionary 55097 56714 +2.9% 0.97x(?)
Phonebook 20335 21080 +3.7% 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

@mtake
Copy link
Contributor Author

mtake commented Feb 26, 2017

Created another graph which shows improvements with the new build-system flag over the default build (improvement). Up to 87% of CPU samples have been reduced.

@swiftix
Copy link
Contributor

swiftix commented Feb 26, 2017

@mtake Nice improvements. I think we are going to merge the PR this week. Could you please rebase it on the top of the tree? It seems to have some conflicts at moment.

@mtake mtake force-pushed the enhance-assume-single-threaded branch from 68c4bd1 to 69768ad Compare February 27, 2017 07:56
@swiftix
Copy link
Contributor

swiftix commented Feb 27, 2017

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 68c4bd13f8b4be9ae717d1effb952e34f581d22d
Test requested by - @swiftix

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 68c4bd13f8b4be9ae717d1effb952e34f581d22d
Test requested by - @swiftix

@swiftix
Copy link
Contributor

swiftix commented Feb 27, 2017

@swift-ci please benchmark

1 similar comment
@swiftix
Copy link
Contributor

swiftix commented Feb 27, 2017

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Optimized (O)

Regression (4)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
MapReduceAnyCollection 344 373 +8.4% 0.92x
StringHasPrefix 710 765 +7.8% 0.93x
MapReduce 345 372 +7.8% 0.93x
OpenClose 48 51 +6.2% 0.94x
Improvement (1)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ByteSwap 1 0 -99.9% 1001.00x
No Changes (167)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
ObjectiveCBridgeStubURLAppendPath 216262 210863 -2.5% 1.03x(?)
ReversedDictionary 132 130 -1.5% 1.02x(?)
ObjectiveCBridgeStubToNSStringRef 132 129 -2.3% 1.02x(?)
ObjectiveCBridgeStubDataAppend 3685 3613 -1.9% 1.02x(?)
Prims 785 780 -0.6% 1.01x(?)
ObjectiveCBridgeStubToNSDate 14754 14580 -1.2% 1.01x(?)
ErrorHandling 3156 3129 -0.9% 1.01x(?)
ObjectiveCBridgeStubFromNSString 955 945 -1.1% 1.01x(?)
ObjectAllocation 181 180 -0.6% 1.01x
Dictionary2 2143 2132 -0.5% 1.01x(?)
Join 489 486 -0.6% 1.01x(?)
ObjectiveCBridgeStubURLAppendPathRef 214084 211953 -1.0% 1.01x(?)
ObjectiveCBridgeToNSArray 28400 28202 -0.7% 1.01x(?)
ObjectiveCBridgeStubToNSDateRef 3375 3352 -0.7% 1.01x(?)
Dictionary 811 805 -0.7% 1.01x(?)
ObjectiveCBridgeStubToArrayOfNSString 27587 27420 -0.6% 1.01x(?)
SetUnion_OfObjects 6449 6387 -1.0% 1.01x(?)
ObjectiveCBridgeStubNSDateMutationRef 12442 12274 -1.4% 1.01x(?)
ObjectiveCBridgeFromNSSetAnyObjectForced 4171 4149 -0.5% 1.01x(?)
ArraySubscript 1561 1556 -0.3% 1.00x(?)
ObjectiveCBridgeToNSString 1275 1273 -0.2% 1.00x(?)
StackPromo 24499 24538 +0.2% 1.00x(?)
PopFrontArray 1191 1192 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 142436 142222 -0.1% 1.00x(?)
ClassArrayGetter 13 13 +0.0% 1.00x
Array2D 1941 1950 +0.5% 1.00x(?)
Histogram 243 243 +0.0% 1.00x
DictionaryBridge 2959 2962 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 4933 4938 +0.1% 1.00x(?)
ProtocolDispatch2 158 158 +0.0% 1.00x
ObjectiveCBridgeStubFromNSDateRef 3761 3758 -0.1% 1.00x(?)
MonteCarloPi 45064 45062 -0.0% 1.00x(?)
StringWithCString 200360 200697 +0.2% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 4418 4439 +0.5% 1.00x(?)
SortLettersInPlace 1151 1151 +0.0% 1.00x
DictionarySwap 373 373 +0.0% 1.00x
ArrayAppendToFromGeneric 598 598 +0.0% 1.00x
MapReduceString 79 79 +0.0% 1.00x
ObjectiveCBridgeFromNSDictionaryAnyObject 117997 117812 -0.2% 1.00x(?)
ArrayAppendASCII 19934 19940 +0.0% 1.00x(?)
Dictionary3OfObjects 1004 1009 +0.5% 1.00x(?)
RangeAssignment 318 318 +0.0% 1.00x
MapReduceLazyCollectionShort 60 60 +0.0% 1.00x
SuperChars 220509 220602 +0.0% 1.00x(?)
ArrayAppendLazyMap 910 914 +0.4% 1.00x(?)
XorLoop 353 353 +0.0% 1.00x
ArrayAppendReserved 740 740 +0.0% 1.00x
StringInterpolation 9323 9287 -0.4% 1.00x(?)
AnyHashableWithAClass 67334 67014 -0.5% 1.00x(?)
CharacterLiteralsSmall 804 804 +0.0% 1.00x
Integrate 262 262 +0.0% 1.00x
ArrayPlusEqualSingleElementCollection 57488 57459 -0.1% 1.00x(?)
ArrayAppendStrings 13547 13540 -0.1% 1.00x(?)
ObjectiveCBridgeStubFromNSStringRef 200 200 +0.0% 1.00x
StaticArray 145 145 +0.0% 1.00x
ProtocolDispatch 3030 3030 +0.0% 1.00x
TypeFlood 0 0 +0.0% 1.00x
ArrayLiteral 1406 1412 +0.4% 1.00x(?)
ArrayAppendLatin1 45155 45157 +0.0% 1.00x(?)
CharacterLiteralsLarge 12314 12307 -0.1% 1.00x(?)
Walsh 357 358 +0.3% 1.00x(?)
Dictionary3 592 593 +0.2% 1.00x(?)
StrComplexWalk 2933 2927 -0.2% 1.00x(?)
SetIntersect_OfObjects 1732 1727 -0.3% 1.00x(?)
ArrayOfRef 3887 3883 -0.1% 1.00x(?)
ObserverUnappliedMethod 2685 2692 +0.3% 1.00x(?)
ObjectiveCBridgeToNSSet 36055 35927 -0.4% 1.00x(?)
ArrayAppendOptionals 1222 1222 +0.0% 1.00x
NSError 350 349 -0.3% 1.00x(?)
DictionaryOfObjects 2561 2565 +0.2% 1.00x(?)
PopFrontArrayGeneric 1195 1193 -0.2% 1.00x(?)
PopFrontUnsafePointer 9077 9087 +0.1% 1.00x(?)
StringEqualPointerComparison 7322 7313 -0.1% 1.00x(?)
CaptureProp 809 809 +0.0% 1.00x
PolymorphicCalls 22 22 +0.0% 1.00x
RC4 157 157 +0.0% 1.00x
Calculator 36 36 +0.0% 1.00x
ArrayAppendFromGeneric 598 597 -0.2% 1.00x(?)
ObjectiveCBridgeStubDateMutation 272 272 +0.0% 1.00x
MapReduceShort 2143 2145 +0.1% 1.00x(?)
ArrayAppendUTF16 41739 41732 -0.0% 1.00x(?)
IterateData 2734 2740 +0.2% 1.00x(?)
DictionaryLiteral 1461 1466 +0.3% 1.00x(?)
Hanoi 3619 3618 -0.0% 1.00x(?)
ArrayOfGenericPOD 219 219 +0.0% 1.00x
UTF8Decode 282 282 +0.0% 1.00x
MapReduceLazySequence 47 47 +0.0% 1.00x
SetExclusiveOr 2520 2526 +0.2% 1.00x(?)
SetIsSubsetOf 292 292 +0.0% 1.00x
NopDeinit 21368 21375 +0.0% 1.00x(?)
SetIntersect 320 319 -0.3% 1.00x(?)
MapReduceClassShort 4920 4916 -0.1% 1.00x(?)
ObjectiveCBridgeStubNSDateRefAccess 346 345 -0.3% 1.00x(?)
ArrayInClass 61 61 +0.0% 1.00x
ArrayOfGenericRef 4003 3997 -0.1% 1.00x(?)
Phonebook 7700 7687 -0.2% 1.00x(?)
ObjectiveCBridgeStubDateAccess 181 181 +0.0% 1.00x
Sim2DArray 276 276 +0.0% 1.00x
SetExclusiveOr_OfObjects 7998 7968 -0.4% 1.00x(?)
ArrayAppendRepeatCol 839 839 +0.0% 1.00x
MapReduceShortString 20 20 +0.0% 1.00x
ObjectiveCBridgeToNSDictionary 59787 59612 -0.3% 1.00x(?)
MonteCarloE 10626 10634 +0.1% 1.00x(?)
ReversedBidirectional 50045 49984 -0.1% 1.00x(?)
StringHasSuffixUnicode 60954 61136 +0.3% 1.00x
ArrayAppendToGeneric 598 598 +0.0% 1.00x
HashTest 1805 1806 +0.1% 1.00x(?)
SetIsSubsetOf_OfObjects 362 362 +0.0% 1.00x
ArrayAppend 986 986 +0.0% 1.00x
DictionaryRemove 3114 3123 +0.3% 1.00x(?)
LinkedList 7133 7126 -0.1% 1.00x(?)
RGBHistogramOfObjects 23893 23941 +0.2% 1.00x(?)
ArrayAppendSequence 981 981 +0.0% 1.00x
ArrayAppendArrayOfInt 598 597 -0.2% 1.00x(?)
ArrayOfPOD 166 166 +0.0% 1.00x
SetUnion 2088 2088 +0.0% 1.00x
Chars 1465 1464 -0.1% 1.00x(?)
MapReduceLazyCollection 89 89 +0.0% 1.00x
ReversedArray 49 49 +0.0% 1.00x
StringBuilder 1362 1363 +0.1% 1.00x(?)
ObserverForwarderStruct 1105 1107 +0.2% 1.00x(?)
DeadArray 181 181 +0.0% 1.00x
ArrayValueProp2 6 6 +0.0% 1.00x
BitCount 1 1 +0.0% 1.00x
AngryPhonebook 2928 2933 +0.2% 1.00x(?)
ArrayPlusEqualArrayOfInt 598 598 +0.0% 1.00x
SevenBoom 1477 1473 -0.3% 1.00x(?)
StringWalk 6184 6184 +0.0% 1.00x
ArrayValueProp 6 6 +0.0% 1.00x
ObjectiveCBridgeStubFromArrayOfNSString 52750 52990 +0.5% 1.00x(?)
MapReduceClass 3153 3155 +0.1% 1.00x(?)
ObjectiveCBridgeFromNSString 1398 1399 +0.1% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
Memset 234 234 +0.0% 1.00x
Dictionary2OfObjects 3673 3657 -0.4% 1.00x(?)
ArrayValueProp4 6 6 +0.0% 1.00x
TwoSum 1254 1251 -0.2% 1.00x(?)
ArrayValueProp3 6 6 +0.0% 1.00x
ObjectiveCBridgeStubFromNSDate 3762 3761 -0.0% 1.00x(?)
DictionarySwapOfObjects 6914 6957 +0.6% 0.99x(?)
ObjectiveCBridgeStubToNSString 1517 1525 +0.5% 0.99x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToString 42647 43066 +1.0% 0.99x(?)
ObjectiveCBridgeFromNSStringForced 2289 2310 +0.9% 0.99x(?)
ArrayAppendGenericStructs 1224 1239 +1.2% 0.99x(?)
ArrayPlusEqualFiveElementCollection 60511 60854 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObject 63505 64128 +1.0% 0.99x(?)
DictionaryRemoveOfObjects 22357 22490 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 95211 96564 +1.4% 0.99x(?)
ObjectiveCBridgeFromNSArrayAnyObject 23242 23462 +0.9% 0.99x(?)
NSDictionaryCastToSwift 5209 5261 +1.0% 0.99x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 79818 80365 +0.7% 0.99x(?)
StrToInt 6441 6491 +0.8% 0.99x(?)
StringHasPrefixUnicode 14071 14143 +0.5% 0.99x(?)
RGBHistogram 2610 2626 +0.6% 0.99x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 71139 71578 +0.6% 0.99x(?)
ObjectiveCBridgeStubNSDataAppend 2267 2280 +0.6% 0.99x(?)
RecursiveOwnedParameter 2321 2360 +1.7% 0.98x
SortStrings 1686 1714 +1.7% 0.98x
ObserverClosure 2197 2231 +1.6% 0.98x(?)
SortStringsUnicode 7433 7609 +2.4% 0.98x(?)
171 2811537 2856691 +1.6% 0.98x
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 70102 71768 +2.4% 0.98x(?)
NSStringConversion 742 755 +1.8% 0.98x(?)
ObserverPartiallyAppliedMethod 3708 3767 +1.6% 0.98x
SortSortedStrings 842 869 +3.2% 0.97x
MapReduceSequence 590 616 +4.4% 0.96x
StringHasSuffix 798 828 +3.8% 0.96x
**Unoptimized (Onone)**
Regression (1)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
StringHasSuffix 1641 1787 +8.9% 0.92x(?)
Improvement (1)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
OpenClose 433 398 -8.1% 1.09x(?)
No Changes (170)
TEST OLD_MIN NEW_MIN DELTA (%) SPEEDUP
TypeFlood 174 167 -4.0% 1.04x(?)
StackPromo 101739 98620 -3.1% 1.03x(?)
ObjectiveCBridgeStubURLAppendPath 224501 217474 -3.1% 1.03x(?)
DictionaryBridge 3047 2999 -1.6% 1.02x(?)
ObjectiveCBridgeStubFromNSString 966 948 -1.9% 1.02x
IterateData 11299 11128 -1.5% 1.02x
MapReduceClass 42826 41909 -2.1% 1.02x(?)
ArrayAppendRepeatCol 202195 200921 -0.6% 1.01x(?)
DictionarySwapOfObjects 19773 19646 -0.6% 1.01x(?)
ObjectiveCBridgeFromNSArrayAnyObjectForced 7689 7619 -0.9% 1.01x(?)
ObjectiveCBridgeFromNSDictionaryAnyObject 121216 120223 -0.8% 1.01x(?)
StringHasPrefix 1685 1671 -0.8% 1.01x
ArrayPlusEqualSingleElementCollection 273806 272135 -0.6% 1.01x(?)
StringHasSuffixUnicode 63064 62708 -0.6% 1.01x
ObjectiveCBridgeToNSSet 36700 36493 -0.6% 1.01x(?)
NSError 755 744 -1.5% 1.01x(?)
CaptureProp 100870 100334 -0.5% 1.01x(?)
MapReduceLazySequence 27074 26724 -1.3% 1.01x(?)
ObjectiveCBridgeStubDataAppend 3885 3846 -1.0% 1.01x(?)
DictionaryRemove 18836 18714 -0.7% 1.01x
StrToInt 7614 7550 -0.8% 1.01x(?)
ObjectiveCBridgeStubNSDataAppend 2648 2609 -1.5% 1.01x(?)
Memset 45123 44844 -0.6% 1.01x(?)
Dictionary2OfObjects 6206 6171 -0.6% 1.01x(?)
ArraySubscript 4195 4206 +0.3% 1.00x(?)
MonteCarloPi 53394 53391 -0.0% 1.00x(?)
RecursiveOwnedParameter 9403 9382 -0.2% 1.00x
Integrate 397 397 +0.0% 1.00x
ObjectiveCBridgeFromNSArrayAnyObjectToString 43975 44070 +0.2% 1.00x(?)
ClassArrayGetter 923 927 +0.4% 1.00x
Array2D 606397 606313 -0.0% 1.00x(?)
Histogram 8588 8600 +0.1% 1.00x(?)
ObjectiveCBridgeStubFromNSDateRef 4154 4151 -0.1% 1.00x
StringWithCString 343395 343409 +0.0% 1.00x(?)
Prims 8912 8927 +0.2% 1.00x(?)
SortLettersInPlace 2723 2727 +0.1% 1.00x(?)
DictionarySwap 5424 5415 -0.2% 1.00x(?)
ReversedDictionary 24556 24557 +0.0% 1.00x(?)
ArrayAppendToFromGeneric 658 657 -0.1% 1.00x(?)
MapReduceString 2229 2235 +0.3% 1.00x(?)
ArrayAppendASCII 82740 82551 -0.2% 1.00x(?)
RangeAssignment 5664 5680 +0.3% 1.00x(?)
ByteSwap 10 10 +0.0% 1.00x
ArrayAppendGenericStructs 1299 1294 -0.4% 1.00x(?)
SuperChars 270720 270874 +0.1% 1.00x(?)
ArrayAppendLazyMap 223262 223501 +0.1% 1.00x
ArrayPlusEqualFiveElementCollection 275642 274753 -0.3% 1.00x(?)
XorLoop 22528 22524 -0.0% 1.00x(?)
StringInterpolation 15066 14998 -0.5% 1.00x(?)
ObserverClosure 6614 6626 +0.2% 1.00x(?)
AnyHashableWithAClass 84361 84422 +0.1% 1.00x(?)
CharacterLiteralsSmall 1250 1250 +0.0% 1.00x
ObjectiveCBridgeStubToNSString 1543 1546 +0.2% 1.00x(?)
ArrayAppendStrings 13627 13570 -0.4% 1.00x(?)
ObjectiveCBridgeStubFromNSStringRef 206 206 +0.0% 1.00x
ObjectAllocation 647 650 +0.5% 1.00x(?)
SortSortedStrings 1403 1410 +0.5% 1.00x
ObjectiveCBridgeFromNSSetAnyObject 67428 67555 +0.2% 1.00x(?)
ArrayLiteral 1653 1657 +0.2% 1.00x(?)
ProtocolDispatch2 427 427 +0.0% 1.00x
CharacterLiteralsLarge 13876 13895 +0.1% 1.00x(?)
Walsh 12001 12020 +0.2% 1.00x(?)
Dictionary3 1367 1369 +0.1% 1.00x(?)
Dictionary2 3806 3803 -0.1% 1.00x(?)
StrComplexWalk 8478 8485 +0.1% 1.00x(?)
SetIntersect_OfObjects 11204 11190 -0.1% 1.00x(?)
Join 1301 1300 -0.1% 1.00x(?)
ObserverUnappliedMethod 8445 8449 +0.1% 1.00x(?)
ArrayAppendOptionals 1303 1297 -0.5% 1.00x(?)
ObjectiveCBridgeToNSArray 28831 28839 +0.0% 1.00x(?)
DictionaryOfObjects 4790 4792 +0.0% 1.00x(?)
PopFrontUnsafePointer 176813 176820 +0.0% 1.00x(?)
PolymorphicCalls 763 764 +0.1% 1.00x
ObjectiveCBridgeStubToNSStringRef 147 147 +0.0% 1.00x
Calculator 1025 1029 +0.4% 1.00x
ArrayAppendFromGeneric 660 657 -0.5% 1.00x
MapReduceSequence 40916 41000 +0.2% 1.00x
MapReduceShort 46805 46708 -0.2% 1.00x(?)
DictionaryLiteral 12649 12648 -0.0% 1.00x(?)
Hanoi 16678 16672 -0.0% 1.00x(?)
ArrayOfGenericPOD 3071 3076 +0.2% 1.00x(?)
DictionaryRemoveOfObjects 53243 53002 -0.5% 1.00x(?)
UTF8Decode 38209 38222 +0.0% 1.00x(?)
SortStringsUnicode 8778 8810 +0.4% 1.00x
SetExclusiveOr 20695 20733 +0.2% 1.00x(?)
171 6462409 6490305 +0.4% 1.00x
SetIsSubsetOf 1624 1617 -0.4% 1.00x
Dictionary 1807 1809 +0.1% 1.00x(?)
NopDeinit 43962 43966 +0.0% 1.00x(?)
ObjectiveCBridgeStubToArrayOfNSString 27876 27830 -0.2% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObject 24962 25034 +0.3% 1.00x(?)
SetIntersect 10564 10551 -0.1% 1.00x(?)
NSDictionaryCastToSwift 6555 6585 +0.5% 1.00x(?)
ObjectiveCBridgeStubNSDateRefAccess 1187 1186 -0.1% 1.00x(?)
StringBuilder 2890 2886 -0.1% 1.00x(?)
ArrayInClass 4488 4487 -0.0% 1.00x
ArrayOfGenericRef 9645 9636 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSString 3935 3944 +0.2% 1.00x(?)
ObjectiveCBridgeStubDateAccess 1000 1000 +0.0% 1.00x
Sim2DArray 30521 30525 +0.0% 1.00x(?)
SetExclusiveOr_OfObjects 41162 41100 -0.1% 1.00x
ObjectiveCBridgeStubDateMutation 515 515 +0.0% 1.00x
MapReduceShortString 234 235 +0.4% 1.00x(?)
MonteCarloE 82851 82624 -0.3% 1.00x
SetUnion_OfObjects 29662 29638 -0.1% 1.00x(?)
RC4 7272 7242 -0.4% 1.00x
ArrayAppendToGeneric 660 659 -0.1% 1.00x(?)
HashTest 5848 5868 +0.3% 1.00x(?)
LinkedList 33374 33377 +0.0% 1.00x(?)
MapReduceAnyCollection 36791 36823 +0.1% 1.00x(?)
RGBHistogramOfObjects 89457 89448 -0.0% 1.00x(?)
NSStringConversion 1288 1292 +0.3% 1.00x(?)
MapReduceLazyCollection 32987 32940 -0.1% 1.00x
ArrayAppendSequence 71386 71093 -0.4% 1.00x(?)
ArrayAppendArrayOfInt 655 654 -0.1% 1.00x(?)
ArrayOfPOD 1891 1891 +0.0% 1.00x
SetUnion 11664 11618 -0.4% 1.00x(?)
Chars 7351 7351 +0.0% 1.00x
RGBHistogram 31867 31880 +0.0% 1.00x(?)
BitCount 98 98 +0.0% 1.00x
AngryPhonebook 3096 3087 -0.3% 1.00x(?)
ArrayPlusEqualArrayOfInt 657 656 -0.1% 1.00x
SevenBoom 1612 1610 -0.1% 1.00x(?)
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced 72528 72552 +0.0% 1.00x(?)
ArrayValueProp4 3695 3681 -0.4% 1.00x(?)
StringWalk 22192 22221 +0.1% 1.00x(?)
ObjectiveCBridgeStubFromArrayOfNSString 53104 53207 +0.2% 1.00x(?)
GlobalClass 0 0 +0.0% 1.00x
TwoSum 4654 4644 -0.2% 1.00x(?)
ArrayValueProp2 4010 4009 -0.0% 1.00x(?)
ArrayValueProp3 3766 3764 -0.1% 1.00x(?)
ObjectiveCBridgeStubFromNSDate 3895 3898 +0.1% 1.00x(?)
ObserverPartiallyAppliedMethod 8098 8082 -0.2% 1.00x(?)
ObjectiveCBridgeToNSString 1310 1317 +0.5% 0.99x(?)
PopFrontArray 10837 10935 +0.9% 0.99x(?)
ArrayAppendLatin1 103852 104378 +0.5% 0.99x
MapReduceLazyCollectionShort 42484 42775 +0.7% 0.99x(?)
ProtocolDispatch 5803 5836 +0.6% 0.99x(?)
ArrayOfRef 8576 8642 +0.8% 0.99x(?)
ObjectiveCBridgeStubURLAppendPathRef 219419 220822 +0.6% 0.99x(?)
ObjectiveCBridgeStubToNSDateRef 3311 3338 +0.8% 0.99x(?)
PopFrontArrayGeneric 8152 8211 +0.7% 0.99x
StringEqualPointerComparison 9684 9779 +1.0% 0.99x
ArrayAppendUTF16 102956 103667 +0.7% 0.99x
MapReduceClassShort 51095 51460 +0.7% 0.99x(?)
Phonebook 21304 21509 +1.0% 0.99x
ObjectiveCBridgeToNSDictionary 59185 60041 +1.4% 0.99x(?)
SetIsSubsetOf_OfObjects 1586 1599 +0.8% 0.99x(?)
StringHasPrefixUnicode 15650 15826 +1.1% 0.99x
ObjectiveCBridgeFromNSSetAnyObjectForced 7151 7208 +0.8% 0.99x(?)
ReversedArray 517 522 +1.0% 0.99x(?)
ObserverForwarderStruct 4661 4690 +0.6% 0.99x
DeadArray 126330 127394 +0.8% 0.99x(?)
ArrayValueProp 3399 3429 +0.9% 0.99x
ObjectiveCBridgeFromNSDictionaryAnyObjectToString 145600 148813 +2.2% 0.98x(?)
SortStrings 2634 2679 +1.7% 0.98x
ObjectiveCBridgeFromNSDictionaryAnyObjectForced 7448 7574 +1.7% 0.98x(?)
ObjectiveCBridgeFromNSStringForced 2656 2697 +1.5% 0.98x(?)
Dictionary3OfObjects 2182 2222 +1.8% 0.98x(?)
MapReduce 37124 37737 +1.6% 0.98x(?)
ObjectiveCBridgeFromNSSetAnyObjectToString 85405 86843 +1.7% 0.98x(?)
ErrorHandling 3998 4106 +2.7% 0.97x(?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 73665 75556 +2.6% 0.97x(?)
ArrayAppend 3558 3670 +3.1% 0.97x
ReversedBidirectional 139019 143449 +3.2% 0.97x(?)
ArrayAppendReserved 3207 3312 +3.3% 0.97x
ObjectiveCBridgeStubToNSDate 14576 15213 +4.4% 0.96x(?)
StaticArray 4596 4779 +4.0% 0.96x
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced 98130 101821 +3.8% 0.96x(?)
ObjectiveCBridgeStubNSDateMutationRef 15011 15674 +4.4% 0.96x(?)
**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

@swiftix
Copy link
Contributor

swiftix commented Feb 27, 2017

@mtake We are good to go! Thanks again for working on this!!!

@swiftix swiftix merged commit 6c1eec8 into swiftlang:master Feb 27, 2017
@mtake
Copy link
Contributor Author

mtake commented Feb 28, 2017

@swiftix @gottesmm @slavapestov Thank you all for taking time to review and feedback!

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.

5 participants