X
Business

How (and why) is Microsoft tweaking its 'Chakra' JavaScript engine in IE10?

What kinds of changes is Microsoft making to its JavaScript engine in IE10? A couple of recent Microsoft blog posts offer some details.
Written by Mary Jo Foley, Senior Contributing Editor

When Microsoft introduced Internet Explorer (IE) 9, one of the key new components of that browser was its JavaScript engine, codenamed "Chakra."

Chakra is still alive and well in IE10, and will be part of the one HTML5 browsing engine that will power both the Metro-Style and Desktop in Windows 8 and Windows RT. (It also will power the version of IE10 that is coming for Windows 7, as far as I know. There have been no publicly-released test builds from the Softies of IE10 for Windows 7 since Platform Preview 2 a year ago, but supposedly this product is still coming.)

Microsoft officials have said in the past that they've focused heavily -- though not exclusively -- on IE's JavaScript engine to improve browser performance. (IE's Trident rendering engine obviously has an impact on performance, too.)

The guiding principle since IE9 has been that HTML5 apps will work better on multi-core machines where the browser can take advantage of multicore performance. Chakra was built to take advantage of two cores, with the second core compiling JavaScript down to native machine code to help speed up the browser.

According to the latest IEBlog posts, Microsoft has been honing Chakra in some major ways since IE9.

Over the past year-plus, Chakra team has been optimizing for JavaScript-intensive apps. These aren't typically your ordinary, garden-variety real Web apps. Instead, they tend to be HTML5 games and simulations. (That explains the IE team's fondness for test cases like the BubbleMark simulation and Cut the Rope.)

To get these kinds of apps to run even faster, here's what the team said it did:

  • Updated Chakra’s JIT (just-in-time) compiler. "We added support for two additional processor architectures: x64 and ARM. That’s why, whether your JavaScript application is experienced by the user on a 64-bit PC or an ARM-based tablet, it enjoys the benefits of executing directly on the CPU."
  • Changed "the fundamental approach to generating machine code." According to this week's post, Chakra’s IE10 compiler generates fewer machine instructions for code, "reducing the overall memory footprint and speeding up execution." Apps with floating-point arithmetic, HTML5 games and simulations will be where these changes are most readily noticed.
  • Tweaked Chakra's memory allocator and garbage collector. "Chakra now delays the garbage collection at the end of script execution and requests a callback from the browser after an interval of script inactivity," the post explained. The result? The memory footprint shrinks when the browser or one of its tabs becomes inactive. It also means the frequency of garbage collection in animation-driven apps is reduced.

As I've mentioned previously, I've stopped using IE9 because it is slow to load regular-old Web sites on my Windows 7 laptop, an Asus UL30A with Windows Home Premium. (And that's with plug-ins disabled.) Hopefully, next-generation PCs and laptops will have more capable processors that will take advantage of these Chakra enhancements. If not, all these fancy tweaks won't do anything to entice me to go IE10. On Windows RT tablets, I might have less of a choice, if IE is the only browser that can take truly advantage of these JavaScript/JIT enhancements and which is allowed to use plug-ins.

I'm curious to hear what the IE team is doing on the Windows Phone front, going forward. Rumors from earlier this year pointed to the IE Mobile team using a proxy server to deliver pages more quickly in IE10 Mobile on Windows Phone 8 devices. Yes, seemingly like Amazon is doing with Silk....Browser as a service, anyone?

Editorial standards