• On TV.com: MAD MEN: You Say You Want a Revolution
August 22, 2008 1:30 PM PDT

Mozilla: Web apps faster with Firefox 3.1

by Stephen Shankland

Updated at 2:40 p.m. PDT with more details about Firefox 3.1 features.

Firefox 3.1 will run many Web-based applications such as Gmail faster through incorporation of a feature called TraceMonkey that dramatically speeds up programs written in JavaScript, Mozilla said Friday.

JavaScript has been very broadly used to add pizzazz or flexibility to Web pages over the years, but in recent years, it's also become the plumbing for many rich Internet applications. However, because JavaScript has been hobbled by pokey performance, Web-based applications often struggled to work as responsively as "native" software running directly on PCs, and programmers writing Web applications have often turned to other options, such as Adobe Systems' Flash and Flex.

Now Mozilla hopes to change the balance of power in JavaScript's favor.

"TraceMonkey is a project to bring native code speed to JavaScript," said Mike Shaver, Mozilla's interim vice president of engineering, adding that JavaScript performance nearly doubles compared to Firefox 3.0, based on the SunSpider test of JavaScript performance. That speeds up many basic tasks, but it also brings image editing and 3D graphics into JavaScript's abilities, he said.

On Thursday, Mozilla programmers built TraceMonkey into the latest developer version of the open-source Web browser, and it will appear in the next released test version, which likely will be the first beta of Firefox 3.1, Shaver said. Firefox 3.1 is due in final form by the end of the year, though Mozilla is willing to let the schedule slip a bit, if necessary.

TraceMonkey dramatically improves the speed of many JavaScript operations.

TraceMonkey dramatically improves the speed of many JavaScript operations. (Click to enlarge.)

(Credit: Mozilla)

JavaScript execution speed can make surfing the Web snappier, so naturally, it's a key part of the resurgent browser wars between Microsoft's Internet Explorer, Mozilla's Firefox, Apple's Safari, and Opera. "We're as aware as anybody that the market is competitive again," Shaver said.

The SunSpider JavaScript test shows a boost of 83 percent, according to programmer and JavaScript pioneer Brendan Eich, who has worked on TraceMonkey and blogged about it on Friday. However, that speed test is an artificial benchmark that is an imperfect reflection of actual JavaScript applications such as Yahoo's Zimbra e-mail software.

Another illustration of TraceMonkey speed is a video of photo editing. Contrast and brightness adjustments take about 100 milliseconds instead of more than 700.

Shaver discussed TraceMonkey on his own blog too.

TraceMonkey explained
TraceMonkey's name is a cross between SpiderMonkey, Mozilla's current engine for interpreting JavaScript code, and a technique called tracing developed at the University of California at Irvine by Andreas Gal and others. Gal is TraceMonkey's lead architect, Shaver said.

TraceMonkey is what's called a just-in-time compiler, one type of technology that solves the problem of converting programs written by humans into instructions a computer can understand.

Most software that runs on people's computers is already compiled in advance into what's called a binary file, but JavaScript usually is interpreted line by line as it runs, a slower process. "We're getting close to the end of what you can do with an interpreter," Shaver said.

A just-in-time compiler, though, creates that binary file on the fly as the code arrives--when a person visits a new Web page, and the browser encounters JavaScript, for example.

TraceMonkey concentrates only on translating selected high-priority parts of software, though. By tracing and recording JavaScript program execution, TraceMonkey finds loops of repeated activity where programs often spend a lot of time. These loops of actual software behavior then are compiled into native instructions the computer can understand.

In contrast, some compilers translate the entire program, a burdensome process that involves mapping all possible paths the computer can take through the code and trying to figure out which are most important. Tracing technology, based on the actual execution of the program, concentrates only on the areas that actually occupy the computer.

"It lets us focus our optimization energy on the parts of the program that matter most," Shaver said.

That concentration means that TraceMonkey doesn't require a lot of memory or a slow-loading plug-in, Shaver said. And it also means that it's good for mobile devices, one of Mozilla's main focuses for browser development.

There's still a lot of work to be done in improving Web-based applications, though. Mozilla's next priority is improving the DOM--the document object model elements of Web browsers that are in charge of drawing and manipulating the Web page overall.

Although TraceMonkey currently is built into the new developer version of Firefox 3.1, it's disabled by default to begin with. "We did that because we want to get wider feedback," Shaver said.

Also in Firefox 3.1
Other significant changes will arrive in Firefox 3.1, Shaver said.

One is support for threading by JavaScript programs. Threads are instruction sequences, and newer multicore processors are able to run multiple threads simultaneously. Software support for that will mean JavaScript programs can execute some tasks in the background better, Shaver said.

Another is the built-in ability to play music encoded with the Ogg Vorbis format and video encoded with the Ogg Theora format. These formats, while not nearly as widely used or as supported as rivals such as MP3, are free from proprietary constraints such as patents, Shaver said, and therefore can be added to an open-source project such as Firefox.

"We're excited to bring unencumbered, truly open-source video to the Web," Shaver said. The support also works on all operating systems Firefox supports.

Mozilla will start encouraging Firefox users more actively to move to the current version soon. In about the next two weeks, Firefox 2 users will start getting messages to upgrade to version 3, Shaver said.

Currently, when copies of Firefox 2 check Mozilla servers to see if there's an update, the servers don't say to move all the way to version 3, so users must manually update.

"We're looking at doing that in the next two weeks," Shaver said. "The majority of users are still on Firefox 2."

Stephen Shankland writes about a wide range of technology and products, but has a particular focus on browsers and digital photography. He joined CNET News in 1998 and since then also has covered Google, Yahoo, servers, supercomputing, Linux and open-source software, and science. E-mail Stephen, or follow him on Twitter at http://www.twitter.com/stshank.
Recent posts from Business Tech
Microsoft releases SDK for Facebook
EC formally objects to Oracle buying Sun
Compuware completes Gomez buyout
VMware elevates its desktop virtualization view
PC processor shipments break record
After 5 years, Firefox faces new challenges
Cisco ruffles feathers with new collaboration tools
Nvidia CEO says 'no' to Intel-compatible chip
Add a Comment (Log in or register) (12 Comments)
  • prev
  • 1
  • next
by skillingssucks August 22, 2008 4:35 PM PDT
Rock on Mozilla!
Reply to this comment
by onlyauser August 22, 2008 5:50 PM PDT
luv da fox
Reply to this comment
by thabassman August 22, 2008 6:17 PM PDT
FIREFOX.
Reply to this comment
by zahadum August 22, 2008 11:00 PM PDT
pls add mention of platform features for ffox.

Eg, ffox for mac has some streams that are very noteworthy:

First, there is camino - tthe cocoa port (Cairo imaging and gecko rendering engine) - but they are always behind one cycle of what mozilla releases generically (for osx), so it would be nice to know if ffox ver 3.1 finally represents a full parity/sync if the mainline release cycle!?

Second, there is supposed to be some official effort by mozilla to have their own mainline cocoa widgetry - but it's status is not clear (nor is the relationship between this official effort and the personal side project of mozilla staffers on the camini project) - so some edeutorial followup would be useful here!

Third, mozilla keeps saying that their their UI widgetry - cup- can have bindings to any language ... So it is inclear why their official mac team has not leveraged this capacity with native objectiveC bindings, so that ffox may be a first class OSX citizen, instead of this weird c++ stepschild on osx!? ... Is thispossibility related to cocoa widgets version I mentioned above?
Reply to this comment
by Collin1000 August 23, 2008 12:23 AM PDT
As one of the live chat volunteers for mozilla, I almost cried when I read most users are still on FF2. When FF3 launched we had a nightmare of users non stop pouring in about issues upgrading and how to work the new features... and those were the early adopters? Were screwed!
Reply to this comment
by Lerianis August 25, 2008 12:19 AM PDT
You're not screwed. There are plenty of people who are waiting to upgrade because they heard the same 'bad stuff' from people who are supposedly in the know (who actually AREN'T) that people heard about Vista when it first came out.
by alejoche August 23, 2008 12:01 PM PDT
I don't Belive that!.
Reply to this comment
by Seaspray0 August 24, 2008 5:51 PM PDT
The results look impressive. It's not often you find programmers who are concerned about performance these days.
Reply to this comment
by Lerianis August 25, 2008 12:20 AM PDT
Yeah, I am REALLY happy about TraceMonkey. It seems to not only speed up JavaScript applications, but other things that use JavaScript. Some pages that took nearly 10 second to load are now loading almost instantaneously, and I am 99% sure that is because of TraceMonkey.
by internetworld7 August 25, 2008 5:03 PM PDT
Nice article but the Webkit team beat Mozilla to the punch with Squirrelfish. ?
Reply to this comment
by hesham mousa September 19, 2008 9:36 PM PDT
Thank you very much
Reply to this comment
by TechnologyNews October 20, 2008 1:24 AM PDT
Wow, It's great I love to see these new changes

find a similar post on this URL .
http://www.zahipedia.com/2008/10/19/firefox-gives-a-heads-up-to-rivals-with-beta-of-31/
Reply to this comment
(12 Comments)
  • prev
  • 1
  • next
advertisement

After 5 years, Firefox faces new challenges

Mozilla helped reshape the Web since releasing Firefox 1.0 five years ago. Now it's got a reawakened Microsoft and Google Chrome to reckon with.

There's a map for that: GPS or smartphone?

Almost every handset comes with mapping software these days, but standalone GPS devices are becoming more affordable than ever.

advertisement

About Business Tech

Your destination for the latest news on enterprise-level information technology, from chip research and server design to software issues including programming, open source and patents.

Add this feed to your online news reader

Business Tech topics

advertisement
advertisement

Inside CNET News

Scroll Left Scroll Right