Feeds

Opera revs JavaScript engine of the future

It goes to eleven

Build a business case: developing custom apps

Opera is building a new JavaScript engine. And one day, the Norwegian browser mavens say, it will be the fastest the web has ever seen.

Under development for several months now, the new engine is known as Carakan, and according to private Norwegian tests, it's already two and a half times faster than the JavaScript engine woven into the recently released Opera 10 alpha.

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."

The world calls it JavaScript. But the Browserati know better.

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.

Opera's core-technology team has overhauled their JavaScript - er, ECMAScript - engine in three distinct ways. For one, they've switched from a stack-based bytecode instruction set to a register-based set. Rather than using a single stack of values, Carakan stores values in fixed registers accessible by any instruction.

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.

Like Opera predecessors - including Futhark, Linear A, and Linear B - the new engine shares its name with a much older breed of script. Carakan is both modern-day JavaScript engine and pre-colonial Javanese script. ®

Bridging the IT gap between rising business demands and ageing tools

More from The Register

next story
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
Mozilla fixes CRITICAL security holes in Firefox, urges v31 upgrade
Misc memory hazards 'could be exploited' - and guess what, one's a Javascript vuln
Put down that Oracle database patch: It could cost $23,000 per CPU
On-by-default INMEMORY tech a boon for developers ... as long as they can afford it
Google shows off new Chrome OS look
Athena springs full-grown from Chromium project's head
Apple: We'll unleash OS X Yosemite beta on the MASSES on 24 July
Starting today, regular fanbois will be guinea pigs, it tells Reg
HIDDEN packet sniffer spy tech in MILLIONS of iPhones, iPads – expert
Don't panic though – Apple's backdoor is not wide open to all, guru tells us
prev story

Whitepapers

Designing a Defense for Mobile Applications
Learn about the various considerations for defending mobile applications - from the application architecture itself to the myriad testing technologies.
Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Top 8 considerations to enable and simplify mobility
In this whitepaper learn how to successfully add mobile capabilities simply and cost effectively.
Seven Steps to Software Security
Seven practical steps you can begin to take today to secure your applications and prevent the damages a successful cyber-attack can cause.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.