Xcode 10 Performance Tests
This morning, with Xcode 10 updated yesterday with iOS 12, I thought I'd take a run at the Quipper code that is based on Swift 4.2. In the past tests on Xcode 9, I was seeing times in the 40 msec (Release build) and that was nice as it was fully 20 msec faster than ObjC on the same machine, but it's still a far cry from the 6 msec of Clojure on the same machine.
But I've heard a lot about the speed improvements in iOS 12, and it seemed like a smart thing to test the performance on the same code, on the same box - but with Xcode 10. So I did. Wow.
2018-09-18 06:59:04.76 Clearing out all old data for the attack... 2018-09-18 06:59:04.79 List of Possibles: 2018-09-18 06:59:04.79 ... bivteclnbklzn :: 1 2018-09-18 06:59:04.79 ... O :: 2 2018-09-18 06:59:04.79 ... ncc :: 29 2018-09-18 06:59:04.79 ... pt :: 40 2018-09-18 06:59:04.79 ... vzglcddp :: 46 2018-09-18 06:59:04.79 ... ukl :: 589 2018-09-18 06:59:04.79 ... Fict :: 1727 2018-09-18 06:59:04.79 ... lcpji :: 2168 2018-09-18 06:59:04.79 Starting the word block attack... 2018-09-18 06:59:04.79 working on word: 0 [bivteclnbklzn] - 1 possible matches 2018-09-18 06:59:04.80 working on word: 1 [O] - 2 possible matches 2018-09-18 06:59:04.80 working on word: 2 [ncc] - 29 possible matches 2018-09-18 06:59:04.80 working on word: 3 [pt] - 40 possible matches 2018-09-18 06:59:04.80 working on word: 4 [vzglcddp] - 46 possible matches 2018-09-18 06:59:04.80 working on word: 2 [ncc] - 29 possible matches 2018-09-18 06:59:04.80 working on word: 3 [pt] - 40 possible matches 2018-09-18 06:59:04.80 working on word: 4 [vzglcddp] - 46 possible matches 2018-09-18 06:59:04.80 working on word: 5 [ukl] - 589 possible matches 2018-09-18 06:59:04.80 working on word: 6 [Fict] - 1727 possible matches 2018-09-18 06:59:04.80 working on word: 7 [lcpji] - 2168 possible matches 2018-09-18 06:59:04.80 1 Solution(s) took 7.602294921875 msec
I was just shocked - 7.6 msec - that's within reasonable tolerance with the Clojure code - and all that improvement is in the compiler! I have to tip my hat to the Xcode engineers - that's an amazing improvement. I'm guessing that macOS Mojave is going to be quite a treat in a week, as it's been built with these tools. That's something very nice to look forward to.
For now, I'm super happy with the performance of Swift 4.2 - and while I'm not a huge fan of the syntax, it's got the performance that means it's something to take seriously, and use as opposed to Clojure which was problematic on the iOS and macOS apps anyway.
Great News!