RealTime IT News

Opera Claims Lead in Browser JavaScript Race

Norway's browser vendor Opera wants the world know who has the fastest browser on earth. With Opera's introduction of its new JavaScript engine called Carakan, the browser maker is claiming it's ahead of the pack.

However, the big horses of browsers are pushing speed performance, too, including Mozilla's Firefox, Apple's Safari, Google's Chrome as well as Opera's namesake browser.

Each vendor is trying to push the speed limit with a critical element of the modern Web browsing experience -– the JavaScript engine. Modern AJAX -heavy Web sites use a lot of JavaScript to deliver a Web 2.0 experience.

The ability to execute JavaScript is a factor in the overall speed of a particular Web site or Web-based application. The general idea is that if you have faster JavaScript execution, you'll have a faster browsing experience.

"For a long time we have given priority to performance but, interestingly a lot has happened in the JavaScript engine space in the last year or so," said Lars Erik Bolstad, Opera's VP of Core Technology. "We share the view with our competitors that JavaScript speed execution is important for the future of Web applications," he told told InternetNews.com.

How the other guys do it

Last year, Apple rolled out its SquirelFish Extreme engine, which Apple claimed to be twice as fast as its original SquirelFish JavaScript engine.

Mozilla has been working on its own super-fast JavaScript engine called TraceMonkey.

Not to be outdone, Google has claimed that its V8 JavaScript engine in the Chrome browser is the speediest.

All the browser vendors are using different techniques to boost execution speed for JavaScript. For example, Bolstad said, Opera's Carakan will use a register-based bytecode instruction set, which differs from Opera's previous JavaScript engine. That used a stack-based instruction set. The difference between the two approaches is that with a register approach each instruction set gets a fixed block of values in the engine as opposed to a dynamically-allocated block of values.

"Instead of only looking at the values at the top of the stack, each instruction can access any register," Opera developer Jens Lindstrom explained in a blog post. "Since there is no need to copy values to and from the top of the stack to work on them, fewer instructions need to be executed, and less data needs to be copied."

It's all part of a plan to claim fastest status.

Opera's Carakan is still a work in progress and does not yet have native compilation as part of its build. Meanwhile, Google's Chrome V8 does have native compilation currently implemented and it's something that Google continues to build upon.

Earlier this week, Google Chrome software engineers blogged about a new regular expression implementation that Google claims will further V8's JavaScript performance.

JavaScript engine performance measurement can be a tricky. Results often vary depending on the test used and the Web applications being tested. For example, in September of 2008, Mozilla disputed some of Google's V8 speed claims simply by looking at a different test parameter.

"It's probably unrealistic for us to be faster than all the others on all possible tests," Bolstad admitted. "And it's true that there is no one engine that today is faster on all tests."

And while JavaScript performance is important, it's not the only approach to faster browsers. Image rendering and overall memory management are important factors, too. But JavaScript is where the horses are racing.

"It's certainly interesting and good to have this competition on an isolated part of the browser," Bolstad commented.

"Even if we improve JavaScript speed by a factor of three to five times it might not even be that noticeable for the end user who is surfing the New York Times or running Google Gmail. This is more about positioning ourselves for the future and more complex computation heavy web applications that we expect to see."