Mozilla: Web apps faster with Firefox 3.1

By Stephen Shankland, CNET News.com
Monday, August 25, 2008 10:44 AM

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 has 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.

JavaScript execution speed can make surfing the Web snappier, so naturally, it is 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 is 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 is 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 does not require a lot of memory or a slow-loading plug-in, Shaver said. And it also means that it is good for mobile devices, one of Mozilla's main focuses for browser development.

There is 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 is 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 is an update, the servers do not 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."

This article was first published as a blog on CNET News.com.


WORTHWHILE?

1

1 votes
Blog

Talkback 0 comments

There are currently no comments for this post.


Tech Jobs Now!

Search for your ideal tech job:

Configure Apache to support multiple SSL sites on a single IP address

Open Source

With Apache 2.2.12 and support for the Server Name Indication extension to the SSL protocol, you can configure name-based HTTPS sites, just as you can name-based HTTP sites.


Read more »



Amendments to empower Copyright Tribunal

Blog thumbnail

As a lawyer, I often inform my clients about the need to clear licenses with the various licensing societies whenever they use works belonging to other parties. This is especially..... by Bryan Tan

Read more »

Tags

  1. antivirus
  2. apple ipod
  3. cnet networks inc.
  4. desktop
  5. e - mail
  6. hard drive
  7. intuit inc.
  8. mcafee inc.
  9. microsoft corp.
  10. microsoft windows
  11. microsoft windows vista
  12. microsoft windows xp
  13. norton co.
  14. pc
  15. performance
  16. security
  17. software
  18. tool
  19. web
  20. web site