Saturday, September 28, 2013

Insight into why iOS7 applications run faster in 64-bit mode than 32-bit mode


I'd been wondering about quite how Apple had been getting the impressive performance improved reported in some of the iPhone 5S v iPone 5 benchmarks. The improvement is better than could be explained just by the ISA changes, and it seemed unlikely that Apple would have made microarchitectural improvements that impacted only 64-bit mode. I've just read an article which sets out how Apple are exploiting the ARM64 architecture to speed up the critical software operations of object creation and destruction. To summarise, when supporting a 8 Gbyte virtual user address space (iOS7), a 64-bit value can contain many bits of information in addition to those needed to hold the address, and this is what Apple has done.  The article's author, Mike Ash, reports very significant speed-ups (1.9x to  2.4x):

"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."


No comments:

Search This Blog