Feeds

Mozilla mimics Google's native code demo in JavaScript

Time for a Jäger shot

Secure remote control for conventional and virtual desktops

Velocity Mozilla believes that its JavaScript engine isn't that far from matching the performance of Google's Native Client plug-in, which eschews web standards to run native code inside the browser.

Speaking today at the net-performance obsessed Velocity conference in Santa Clara, California, Mozilla open source evangelist Chris Blizzard showed off a Firefox JavaScript demo meant to mimic a test that Google uses to show off Native Client, and he said that even with today's Firefox, Mozilla comes within 50 per cent of the performance of native code.

In a web video here, Google shows off a Native Client incarnation of a web-based photo editing app that lets you apply filters in realtime. Blizzard and Mozilla have ported the same app to JavaScript, achieving performance of about seven frames a second versus Google's 15 frames a second.

As Blizzard said, the JavaScript photo demo was "pretty snappy."

"We've started to realize we can do things that would normally be done in native code," Blizzard said. "But we can do them in JavaScript." Just yesterday, Mozilla vice president of product Jay Sullivan told us that the open source outfit has no intention of bundling a Native Client-like plug-in with its browser, preferring to advance standard technologies like HTML5 and JavaScript.

As Blizzard pointed out, the next version of Firefox – Firefox 4, due in beta any day now – will include a new extension to the browser's existing JavaScript engine. Dubbed JaegerMonkey, the extension will operate alongside TraceMonkey – an extension that debuted with Firefox 3.5 last year – interpreting JavaScript code unsuited to "tracing."

TraceMonkey speeds performance by detecting code loops and converting them into assembly language. "We find places where code gets executed more than once," Blizzard said. "We basically optimize that code and trace it to native code."

But there are cases where this sort of thing just doesn't work. This happens with, say, recursion or heavily nested code. As it stands, when tracing fails, Firefox falls back on an interpreter that runs JavsScript at circa 2007 speeds.

With JaegerMonkey, Mozilla adds a Just-in-Time (JIT) engine much like those used by the other major browsers. The extension is actually based on the Nitro JIT used by Apple Safari. Firefox will still do tracing – something other browsers don't do – but it will be able to fall back on the baseline JIT, converting entire methods into assembly language.

"The important thing to realize is that we know we have a lot of things we can to do to optimize for really intensive web apps that will get us within [striking distance] of native code speed," Blizzard said. ®

Remote control for virtualized desktops

More from The Register

next story
Download alert: Nearly ALL top 100 Android, iOS paid apps hacked
Attack of the Clones? Yeah, but much, much scarier – report
NSA SOURCE CODE LEAK: Information slurp tools to appear online
Now you can run your own intelligence agency
Microsoft: Your Linux Docker containers are now OURS to command
New tool lets admins wrangle Linux apps from Windows
Microsoft adds video offering to Office 365. Oh NOES, you'll need Adobe Flash
Lovely presentations... but not on your Flash-hating mobe
You stupid BRICK! PCs running Avast AV can't handle Windows fixes
Fix issued, fingers pointed, forums in flames
HTML5 vs native: Harry Coder and the mudblood mobile app princes
Developers just want their ideas to generate money
prev story

Whitepapers

Go beyond APM with real-time IT operations analytics
How IT operations teams can harness the wealth of wire data already flowing through their environment for real-time operational intelligence.
5 critical considerations for enterprise cloud backup
Key considerations when evaluating cloud backup solutions to ensure adequate protection security and availability of enterprise data.
Getting started with customer-focused identity management
Learn why identity is a fundamental requirement to digital growth, and how without it there is no way to identify and engage customers in a meaningful way.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
Simplify SSL certificate management across the enterprise
Simple steps to take control of SSL across the enterprise, and recommendations for a management platform for full visibility and single-point of control for these Certificates.