Wired

Webmonkey

  • Web Dev & Design
    • Ajax
    • Backend
    • Blog Publishing
    • CSS
    • Databases
    • Fonts
    • Frameworks
    • HTML
    • HTML 5
    • JavaScript
    • Mobile
    • Multimedia
    • Programming
    • Security
    • UI/UX
    • Web Standards
  • Software & Apps
    • Browsers
    • Software
    • Web Apps
  • Platform & APIs
    • APIs
    • Identity
    • Location
    • Social
    • Web Services
  • Reference
    • Color Charts
    • HTML Cheat Sheets
    • Special Characters
    • Glossary
    • Templates
    • Code Snippets
  • twitter
  • facebook
  • RSS Feeds
Mar 1 2010
File Under: Browsers, JavaScript

Firefox Borrows a Bit of Safari’s Magic to Speed Up JavaScript

  • By Scott Gilbertson

Mozilla’s Firefox web browser was one of the first to optimize for today’s JavaScript-heavy web pages. Mozilla’s new Tracemonkey JavaScript engine — released with Firefox 3.5 — put the browser at the top of most page rendering speed tests. But lately, Google Chrome, Apple’s Safari and the coming Opera 10.5 have been beating Firefox at its own game.

Mozilla is hoping to change that with some new improvements to Tracemonkey that promise to make Firefox even faster — particularly on JavaScript-heavy websites like Gmail or Facebook.

The new project — JagerMonkey, as it’s known — is built on top of Tracemonkey and borrows its assembler from Apple’s open source Nitro JavaScript engine. As JagerMonkey programmer David Mandeli writes on his blog: “we know [Nitro] is simple and fast from looking at it before… it’s open-source, and it’s well-designed C++, so it was a great fit.”

The goal of JagerMonkey is to cover a couple of blind spots in Tracemonkey’s JavaScript rendering process. Most JavaScript can be compiled “just in time,” that is, optimized by turning it from JavaScript into much faster native code. When that’s possible, Tracemonkey’s performance matches that of Chrome, Safari and Opera.

However, not all of the web’s JavaScript can be converted to native code the way Tracemonkey currently works. Mandeli has a detailed explanation of what sort of code doesn’t work and why, but the short story is that when Tracemonkey doesn’t kick in, Firefox is still rendering that code at the same speed it was in 2007 — in other words, very slowly by today’s standards.

JagerMonkey will change that, handling the code that the existing Tracemonkey engine cannot.

Of course it will be some time before JagerMonkey makes it into Firefox proper. In fact, as of right now it isn’t even in the Firefox nightly builds. If you really must try it for yourself right now, you’ll find a link to the source code on the Mozilla wiki.

So far, the project doesn’t have a roadmap and the wiki page indicates that there are still many optimizations to be done, but when JagerMonkey finally lands, it may well put Firefox back on top in the web browser speed wars.

Photo: Wikimedia Commons, PD

See Also:

  • Firefox 3.1: Speeding Up the Web With Supercharged JavaScript
  • Is Opera 10.5 the ‘Fastest Browser on Earth?’ Maybe.
  • Opera Adds Carakan to Browser JavaScript Engine Wars
  • How Chrome Changed the Web Overnight
Tags: firefox, safari
  • Post Comment  | 
  • Permalink
  • Digg
  • Stumble Upon
  • Facebook
  • Delicious
  • Reddit
  • sesli sohbet
    Firefox "emprunte" de la technologie à Safari pour reconquérir le Trône de la rapidité d'éxecutiuon du javascript
blog comments powered by Disqus

Webmonkey’s Picks

Browse Our Tutorials

HTML, JavaScript, design and more

Cheat Sheets

HTML, CSS and special characters

Color Charts

Brighten up your pages

Cut & Paste Code

Templates and snippets you can steal

Recent Comments

  • Gutschein Paul on Test Drive Your Type With Google Font Preview
  • jinsei on Test Drive Your Type With Google Font Preview
  • kozmetik on Test Drive Your Type With Google Font Preview
  • khaled on Test Drive Your Type With Google Font Preview
  • Imhere460 on Second Beta Release of Firefox 4 Arrives
  • Recent Articles

  • Test Drive Your Type With Google Font Preview
  • Typekit Gets an API
  • W3C’s Unicorn Validator Checks Multiple Standards at Once
  • Apple Updates Safari, Turns on Extensions
  • Second Beta Release of Firefox 4 Arrives
  • Corrections | Sitemap | FAQ | Contact Us | Wired Staff | Advertising | Press Center | Subscription Services | Newsletter | RSS Feeds
    Condé Nast Web Sites:
    Webmonkey | Reddit | ArsTechnica | Details | Golf Digest | GQ | New Yorker

    Registration on or use of this site constitutes acceptance of our User Agreement (Revised 4/1/2009) and Privacy Policy (Revised 4/1/2009).

    Wired.com © 2010 Condé Nast Digital. All rights reserved.

    The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of Condé Nast Digital.