Hypercritical


Time Machine and the future of the file system

Low Level Virtual Machine makes good.

[Update: It turns out that LLVM was not a factor in the OpenGL demo at WWDC. See the next post for corrections.]

In the epilogue to my three-part “Avoiding Copland 2010” series (1, 2, 3) from last year, I examined the possible role of LLVM in the future of Mac OS X. At WWDC, one use of the technology was revealed, albeit under NDA. In a surprising move, Apple has decided to let Chris Lattner, the Apple employee at the center of my earlier post about LLVM, spill the beans.

[I just got official okay to mention this in public. This was previously announced at Apple’s WWDC conference last week.]

For those who are interested, Apple announced that they are using the LLVM optimizer and JIT within their Mac OS 10.5 'Leopard' OpenGL stack

Read the full message for the gory details, and head over to this Macintoshian Achaia thread for some expanded explanations from people who were actually at WWDC and are now (presumably) free to talk about this topic, at least a little.

The executive summary is not technical at all. The LLVM JIT optimizations combined with the new multi-threaded OpenGL stack have yielded a doubling of the frame-rate in “a very popular MMORPG” (which is code for "WoW"). Yikes!

The multi-threaded OpenGL feature may appear in a future version of Tiger, but it currently works exclusively in 10.4.7 on the new Mac Pros. The LLVM stuff is strictly for Leopard, it seems. As games are modified to support multi-threaded OpenGL in Tiger, I guess we’ll see how much of the boost is due to LLVM and how much is a result of multi-threading alone.

Anyway, it just goes to show how a seemingly obscure, low-level technology like LLVM can pay big dividends, even when not used as a pie-in-the-sky general-purpose virtual machine to rival Microsoft’s CLR and bring a memory-managed API to Mac OS X.

But I love pie—and in the sky? Sure! So what is Apple’s long-term plan for LLVM? The LLVM web site lists a lot of interesting features. In its newly revealed role in OpenGL in Leopard, LLVM is proving its abilities as an optimizing compiler. What’s the end game there? How about LLVM replacing gcc as the default compiler in Mac OS X? How do you like that pie?

It’s not as crazy as it seems. LLVM reportedly already produces better native x86 code than gcc, and rumor has it that the LLVM team is staffing up. Obviously, a compiler change isn’t something that’s going to happen any time soon. But a few years from now, who knows? You know how Apple just loves its “transitions.”


This article originally appeared at Ars Technica. It is reproduced here with permission.