free invisible hit counter

Next Firefox Update To Feature Dramatic Speed Boost

The Mozilla Foundation is on the verge of adopting a new software-programming technique that promises to dramatically improve the speeds at which browsers interact with the Web. The first step, the nonprofit organization said, will be to optimize the way that JavaScript runs in Firefox 3.1 — the next incremental update to Mozilla’s popular open-source browser.

Originally developed by Netscape and currently maintained by Mozilla, JavaScript is a powerful cross-platform scripting language that is already used in millions of Web pages and server applications worldwide. Moreover, the scripting language’s deployment in Internet applications such as Firefox is driven by an embeddable JavaScript engine that Mozilla calls SpiderMonkey.

Earlier this summer, Mozilla engineers launched a new project called TraceMonkey that promises to revolutionize Web-browser performance, noted Mike Shaver, Mozilla’s vice president of engineering.

“Based on a technique developed at UC Irvine called ‘trace trees,’” Shaver said, “a few of us have spent the last two months — and most of the last few nights — teaching SpiderMonkey some exciting new tricks.”

Hot Code Paths

University of California researchers have succeeded in building a compiler featuring the ability to dynamically detect frequently executed byte-code instructions and then generate code on the fly for exactly these hot code paths, called “traces.”

“Tracing follows only the hot paths, and builds a trace-tree cache,” noted Mozilla CTO Brendan Eich. Given that “cold code never gets traced,” memory bloat is avoided, he explained.

The early results from Mozilla’s ongoing TraceMonkey project — which adds native code compilation to the organization’s SpiderMonkey engine — takes JavaScript performance to “another level, where instead of competing against other interpreters, we start to compete against native code,” Shaver said. “Even with this very, very early version, we’re already seeing some promising results.”

TraceMonkey employs a new kind of just-in-time compiler to boost JavaScript performance by an order of magnitude or more, Eich noted. For this reason, the new JavaScript engine has just been assimilated into the development tree for Firefox 3.1, which is tentatively slated for release later this year.

Only the Beginning

Shaver notes that several benchmark tests have shown that tracing technology at times can make browser performance 20 to 37.5 times faster. “There are many wins left in each one of those benchmarks, and we’ll be working on those through Firefox 3.1 and beyond,” he said.

Mozilla’s TraceMonkey team still has some bugs to fix, and they have to decide on “an enormous number” of optimization choices, Shaver said. “But we’re charging full-speed ahead on the work we need to do for this to be a part of Firefox 3.1.”

Eich points out that the tracing technology being incorporated into Mozilla’s JavaScript engine is also mobile-friendly. “We have, right now, x86, x86-64, and ARM support in TraceMonkey,” Eich said. “This means we are ready for mobile and desktop target platforms out of the box.”

Mozilla’s CTO also believes that the organization’s initial efforts to exploit tracing technology is only the beginning.

“I believe that other browsers will follow our lead and take JavaScript performance through current interpreter speed barriers,” Eich said. “We are moving the goal posts and changing the game, for the benefit of all Web developers.”

Comments are closed.