It goes to eleven
The current engine, Futhark, was developed to minimize code footprint and memory usage. But with Carakan, Opera feels the need for raw speed. "The web is a changing environment," reads a blog post from Lars Erik Bolstad, Opera's VP of core technology. "Tomorrow's advanced web applications will require faster ECMAScript execution, so we have now taken on the challenge to once again develop the fastest ECMAScript engine on the market."
Bolstad tells The Reg he aims to release a Carakan public build "in the next few months - before the summer, basically." It will not be rolled into Opera 10, due for an official release around the middle of the year.
Since there's no need to copy values to and from the top of a stack, fewer instructions are executed and less data is copied, Bolstad explains.
Two, Carakan will compile portions of ECMAScript programs into native code. This will reduce some of the overhead required to execute certain ECMAScript code in a bytecode interpreter. The native code will look a lot like assembly code, Bolstad says, so that most of it will stay in those registers.
And three, the new engine will improve the way ECMAScript objects are represented. Each object is assigned a class that collects certain data about the object. "This representation allows compact storage of individual objects, since most of the complicated structures representing the object's properties are stored in the class, where they are shared with all other objects with the same class," Bolstad writes.
"In real-world programs with many objects of the same classes, this can save significant amounts of memory. It can be expected that most programs that do create many objects still only have a few different classes of objects."
Bolstad tells us Carakan is now "feature complete." But he and his team are still tweaking the native-code-compilation bit. Running the SunSpider benchmark, Carakan is currently two and a half times faster on ECMAScript than the Opera 10 alpha, aka Presto 2.2. With native-code generation, Bolstad expects significantly greater speed improvements. Some preliminary tests indicate that the native-code Carakan will be 5 to 50 times faster than Opera 10.