Mike Ash Friday Q&A: "64-bit" is not just a marketing gimmic, but neither is it an amazing breakthrough
Wanted to post this article about the A7 and ARM64 from the always amazing Mike Ash. Anyone interested in the little fiddly bits of Objective-c, Cocoa, and Cocoa Touch should definitely check out his blog.
Friday Q&A 2013-09-27: ARM64 and You
Remember this was in September of 2013, shortly after the new iPhone came out. What we all didn't realize, was that Apple was serious about the iPhone 5s being it's most 'forward thinking phone' ever. The move to 64 bit had everything to do with swift. They made these advancements in order to improve certain aspects of swift under the hood, especially now that scalar values are first class objects, which are now stored inside the pointer, instead of at a separate address.
Some test results:
"Adding it all together, it's a pretty big win. My casual benchmarking indicates that basic object creation and destruction takes about 380ns on a 5S running in 32-bit mode, while it's only about 200ns when running in 64-bit mode. If any instance of the class has ever had a weak reference and an associated object set, the 32-bit time rises to about 480ns, while the 64-bit time remains around 200ns for any instances that were not themselves the target.
In short, the improvements to Apple's runtime make it so that object allocation in 64-bit mode costs only 40-50% of what it does in 32-bit mode. If your app creates and destroys a lot of objects, that's a big deal."
"The "64-bit" A7 is not just a marketing gimmic, but neither is it an amazing breakthrough that enables a new class of applications. The truth, as happens often, lies in between.
The simple fact of moving to 64-bit does little. It makes for slightly faster computations in some cases, somewhat higher memory usage for most programs, and makes certain programming techniques more viable. Overall, it's not hugely significant.
The ARM architecture changed a bunch of other things in its transition to 64-bit. An increased number of registers and a revised, streamlined instruction set make for a nice performance gain over 32-bit ARM."
Some further reading on Anand:
The Objective-C runtime
Very cool stuff!