Apple Google Mozilla

Safari’s New JS Interpreter: SquirrelFish

There’s an announcement on the Safari blog about SquirrelFish, their new JS interpreter. To sum it up:

SquirrelFish is a register-based, direct-threaded, high-level bytecode engine, with a sliding register window calling convention. It lazily generates bytecodes from a syntax tree, using a simple one-pass compiler with built-in copy propagation.

Some performance data can be found here, as well as here, which even tests against Tamarin (slated for inclusion in Mozilla2). I think the motive for this move might have been best summarized here:

  1. I can imagine the “performance per watt� power consumption for SquirrelFish is also much lower. Good for my iPhone’s battery life.

Especially with the iPhone going 3G next week which will consume more power, making a web browser be as efficient as possible with CPU cycles not only makes the experience better, but will save battery life. This doesn’t just impact the iPhone as Google’s Android also includes WebKit.

David Mandelin has some analysis and comparison to the Mozilla work being done on his blog.

It’s pretty interesting stuff.

2 replies on “Safari’s New JS Interpreter: SquirrelFish”

Power consumption doesn’t just matter for phones. For a laptop it means battery life too, and for your desktop (well, and the reset) it means electricity consumption and hence carbon footprint.

If 25% of the world’s computers use Firefox and they’re running Firefox 50% of the time (probably a conservative estimate), a 10% performance improvement has a significant carbon impact.

@Ian McKellar: Good point, but Apple’s justification for this effort is really the iPhone. Less CPU cycles is a major win. They need to keep ahead of the competition.

Leave a Reply

Your email address will not be published. Required fields are marked *