You're viewing an article in iPO's historic archive vault. Here, we've preserved the comments and how the site looked along with the article. Use this link to view the article on our current site: An iPhone Performance Secret: LLVM

News

An iPhone Performance Secret: LLVM

Apple has found a way to achieve amazing graphics speed a shirt pocket device, the iPhone, by using a special form of code optimization called "Low Level Virtual Machine," (LLVM) according to graphics and algorithms specialist Charles Ying.

Mr. Ying wrote Thursday that Apple has taken the approach of using its expertise in Mac OS X, OpenGL, and code optimization via LLVM in the development in the iPhone.

Small personal electronics that can fit in your pocket are always short of the electrical power required for fast video processing. And yet Apple has demonstrated very impressive graphics capabilities with the iPhone. The key is extensive code optimization at every stage, from the CPU to the graphics system, from compile to runtime, and that can be done with LLVM.

Because the iPhone is running "OS X," a variant of Mac OS X, Apple can take advantage of their expertise in OpenGL graphics used by Mac OS X to achieve the amazing scrolling feature and finger resizing of graphics of the iPhone. But any interpreted interface, like OpenGL would have to be highly optimized to achieve that kind of performance in a small device. With LLVM, the programmer can enable program optimization in every realm: compile, link, and even at runtime.

Apple has taken several steps to achieve this. Apple has quietly contributed ARM enhancements to LLVM. Secondly, LLVM has been integrated with Apple's primary compiler in Xcode, called gcc.

When all is said and done, Apple has achieved a highly optimized OS X and Open GL code base that can exploit Core Animation on an ARM processor.

This is very likely why Apple chose to use "OS X" in the iPhone and how Apple can achieve amazing graphics in a shirt pocket device with limited electrical power.

1 comments from the community.

You can post your own below.

+ show options

Your current settings, click to change: Sort Oldest First, Show Guest Posts, Hide Community Stats

A guest said: (hide)

What makes you think that OpenGL is an 'interpreted interface'?

While LLVM does support runtime optimizations, it's highly unlikely that this component is used on the iPhone. It's not really necessary (or suitable) for closed/emdedded systems.

Why do you think that Apple has 'integrated [LLVM] with Apple's primary compiler in Xcode'?

Xcode uses GCC. LLVM includes a modified version of GCC (llvm-gcc). Thus, Xcode simply needs to use llvm-gcc.

Quote this post ↓

Post Your Comments

  Remember Me

Not a member? Register now. You can post comments without logging in, but they'll show up as a "guest" post.


Please enter the word exactly as you see it in the image above. Registered users aren't prompted for this. Having trouble reading the image get a new one.