It's hard to ignore all the excitement around the new iPhone 5. Early reviews call it the best iPhone yet, with a bigger screen, a thinner, lighter body, and an improved camera. I'm a performance geek, though, so what I'm most excited about is the new A6 processor that Apple designed for the iPhone 5. According to results from benchmarks like Geekbench and SunSpider, the A6 processor is over twice as fast as the A5 processor that powers the iPhone 4S. That's an impressive increase, especially considering the iPhone 4S is just under a year old!

Apple hasn’t released many details about the new A6 processor (most of what we know about the design and architecture of the A6 comes from an article on AnandTech). However, Apple has released a new version of Xcode that adds a new architecture (armv7s), which tells us that developers must target this new architecture explicitly in order to get the most performance out of the A6 processor.

Before I dive into the details of what I found, I'd like to talk (briefly!) about compilers in case you're not familiar with them. Compilers take the source code programmers write and translate it into the machine code processors understand. Just like there are different languages for source code, there are different languages for machine code. These machine code languages are also known as architectures.

Anyway, Xcode 4.5 supports two different architectures architectures: armv7 (used by the Apple A4 and the Apple A5 processors) and armv7s (used by the Apple A6 processor). Note that armv7s is a superset of armv7. That is, the Apple A6 can run armv7 code, but the Apple A5 cannot run armv7s code.

What changes does the new armv7s architecture introduce? How much does the new armv7s architecture benefit application performance? Normally the best way to answer these questions is by running benchmarks, but the iPhone 5 isn't widely available yet. Instead, I built Geekbench for both architectures and examined the machine code Xcode generated for each architecture to see what differences I could find, and what these differences might mean.

Surprisingly there weren't a lot of differences in the machine code produced for the two different architectures; overall, the armv7s code does not look much different from the armv7 code. However, there were two specific differences that caught my eye.

The first difference affects integer division. The armv7s architecture has two new integer division instructions that aren't present on the armv7 architecture. These integer division instructions are implemented as a function on the armv7 that is at least an order of magnitude slower than the equivalent instruction on the armv7s. Integer division is common in applications (it's called in over a hundred places in Geekbench) so these new instructions should provide a significant increase in performance to all applications.

The second difference affect floating point arithmetic. Xcode uses different floating point arithmetic instructions for the armv7s than for the armv7. The instructions Xcode uses for the armv7s combine several operations into one instruction which should make them more efficient than the several independent instructions that Xcode uses for the armv7. Surprisingly these combined floating point instructions are present in the armv7 architecture but are unused by Xcode. It's unclear why this is the case. For armv7s these combined instructions represent a small proportion of all floating point instructions, so while they will probably provide an advantage it's hard to determine how much of an impact they will have.

There are other differences between the armv7 and the armv7s code, but they're minor in comparison to the integer division and the floating point arithmetic changes outlined above. How much will applications benefit from having an armv7s build? It's hard to say just from examining the generated code, but if you're a developer I think it's worth the time and the effort to ship an armv7s build of your application, especially if your application makes any use of floating point operations.

I'm still waiting, though, to see the difference between Geekbench built for armv7, and Geekbench built for armv7s, on an iPhone 5. As a wise man once said, "there is no progress unless you can measure it".

(Thanks to Deborah Goren and Nick Pannuto for reviewing early drafts of this post.)

John Poole is the founder of Primate Labs and lives in Toronto, Ontario with his wife Deborah. You can find John on Twitter or Google+.