But it won't make it into version 10 of the browser

Feb 5, 2009 16:27 GMT  ·  By

Future versions of Opera will be at least two and a half times faster than what the company currently offers to its users. This because of the introduction of Carakan, a newly developed ECMAScript/JavaScript engine for the browser, which leaves Opera 10 Alpha's Presto 2.2 in the dust. The end purpose with Carakan is that Opera will build, implement and subsequently make available in its browser the fastest ECMAScript engine on the market. A goal that is much more difficult as rivals from Mozilla and Google are using similar development strategies, focusing on delivering top, and increasing, speed with Firefox and Chrome.

“Using a regular cross-platform switch dispatch mechanism (without any generated native code) Carakan is currently about two and a half times faster at the SunSpider benchmark than the ECMAScript engine in Presto 2.2 (Opera 10 Alpha). Since Opera is ported to many different hardware architectures, this cross-platform improvement is on its own very important,” revealed Jens Lindstrom, Opera developer. “The native code generation in Carakan is not yet ready for full-scale testing, but the few individual benchmark tests that it is already compatible with runs between 5 and 50 times faster, so it is looking promising so far.”

According to Lindstrom, Opera's current ECMAScript engine, dubbed Futhark, had a minimal footprint and memory usage when it was initially introduced, but the focus was not placed on achieving the maximum possible execution speed. However, with Carakan, Opera is taking on a completely different approach, in an attempt to keep up the pace with the general evolution of the web. “The name Carakan, like the names of Opera's previous ECMAScript engines, Futhark, Linear A and Linear B, is the name of a writing system, or 'script',” Lindstrom said, adding that the development efforts are focused into three critical areas: register-based bytecode, native code generation and automatic object classification.

“In the new engine, we've opted for a register-based bytecode instruction set. In a register-based machine, instead of a dynamically sized stack of values, there's a fixed size block of them, called 'registers'. Instead of only looking at the values at the top of the stack, each instruction can access any register. 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,” Lindstrom explained.

Moving forward, Carakan will not rely on faster bytecode execution, although such scenarios are possible. Instead, Opera is tweaking the engine so that it is capable of compiling ECMAScript programs and functions into native code. On top of this, Carakan will also be able to generate native code designed to match simple regular expressions. Both tactics lead to gains in performance.

“Another area of major improvement over our current engine is in the representation of ECMAScript objects,” Lindstrom revealed. “In the new engine, each object is assigned a class that collects various information about the object, such as its prototype and the order and names of some or all of its properties. Class assignment is naturally very dynamic, since ECMAScript is a very dynamic language, but it is organized such that objects with the same prototype and the same set of properties are assigned the same class.”

However, the company is in no hurry to implement the new Carakan ECMAScript/JavaScript engine into the Opera browser. According to the Opera Desktop QA manager, end users should not expect to see Carakan in Opera 10.

Opera 10.0 Alpha for Windows is available for download here.

Opera 10.0 Alpha for Linux is available for download here.

Opera 10.0 Alpha for Mac OS X is available for download here.