Swift iOS Performance Update

Harry Cheung
2 min readFeb 27, 2015

This is an update to my broader Mobile App Performance post.

Since Apple came out with two updates to Xcode in two weeks, I thought it would be best to compare Swift performance in a separate post. Using the same performance test from my previous post, I built the app using the current release of Xcode (6.1.1) and the two Xcode betas (6.3 beta and 6.3 beta 2) that were recently made available. Here are the results.

Computational iOS performance tests in seconds (lower is better)

From Xcode 6.1.1 to Xcode 6.3 beta, my test exhibited a huge performance increase for Swift. With Xcode 6.3 beta 2, Xcode introduced the WHOLE_MODULE_OPTIMIZATION option for Swift projects. With this option enabled, the Swift test improved even more. Swift is now on par with my J2ObjC test app which is pure Objective-C. With my hybrid Swift/J2ObjC app, my test app experienced a 10%+ slowdown. Surmising the regression might be related to the new option, I ran the test without the flag enabled, and saw performance return to the previous result. It is unfortunate using the flag caused a tradeoff in my hybrid app.

In general, it is great to see Apple improving Swift performance so greatly in a short period of time. Hopefully, they will have more in store for us when Xcode 6.3 becomes officially released.

Source available here: https://github.com/harrycheung/Mobile-App-Performance

--

--