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

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

Summary: What kinds of changes is Microsoft making to its JavaScript engine in IE10? A couple of recent Microsoft blog posts offer some details.

TOPICS: Browser

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?

Topic: Browser


Mary Jo has covered the tech industry for 30 years for a variety of publications and Web sites, and is a frequent guest on radio, TV and podcasts, speaking about all things Microsoft-related. She is the author of Microsoft 2.0: How Microsoft plans to stay relevant in the post-Gates era (John Wiley & Sons, 2008).

Kick off your day with ZDNet's daily email newsletter. It's the freshest tech news and opinion, served hot. Get it.


Log in or register to join the discussion
  • Joe

    It's also worth remembering that many Metro apps are written using HTML/JS with extensions using the same execution engine. Optimizations here are much more important than just for the web.

    As for 'browser as a service' - I find it to be unusably slow on the Kindle Fire. Let's hope it's optional.
    • Slow, really?

      You notice a difference when you use Amazon's acceleration in the Fire browser? I have turned it on and off and used it both ways for awhile and honestly, I never noticed any difference whatsoever.

      Anyways, I don't see why Microsoft wouldn't make such a feature optional, as some may prefer their privacy (even though they probably wouldn't save anything anyways).
      • Slow... really

        I notice a slight improvement when visiting very common sites. But when there's a cache miss on the amazon servers I would say it's a lot slower than when the feature is off. Would be good to see some hard data.

        Also, many sites are now loaded asynchronously (using ALM or similar). So I wonder how effective the initial page load is.
      • Makes sense...

        That makes sense. If it isn't in Amazon's cache, it will have to first fetch it, store it, then serve it to you instead of serving it up instantly.

        I just never understood why Amazon added such a feature to the Fire anyways. The browser should leverage caching anyways (images, js files, css, etc) without the need of Amazon's own cache. Sure, there is only so much the Fire can cache due to it's small storage space, but style sheets and the like aren't really that big anyways.
  • ie 10 on Windows 8 is nappy

    As in really, really fast. I hope it's that way in the Win 7 version of the product as well.
  • We keep hearing how IE will be ever more responsive

    And yet we keep seeing the same old anemic dog. Maybe IE10.... *wishes upon star*

    Maybe. :_|
    • don't be a troll

      what you don't know, you really don't know. if you haven't used IE10 in windows 8 then please stfu because IE10 its FAST, it's damn FAST!
      • What I don't know?

        I've been dealing with IE since IE was Mosaic via license. It's been anything but a joy cruise over that period [yes dweeb, all 10 versions].

        Watch where you throw around yer STFU's.
        • and still your dont know what your talking about

          So you've used every version of IE, clap clap.

          You still don't know what you're talking about, so STFU
          beau parisi
  • IE10 is pretty snappy but still needs work

    I've been using IE10 in Win8 RP. It seems pretty fast but I am also seeing a lot of incomplete page loads and freezes. The most obvious omission in Metro IE10 is Silverlight because just about any help or information link you click within the Windows 8 settings dialogs takes you to a Microsoft help site that requires Silverlight. They should just bake it in like they did with Flash, even if only for their own sites.
    • Agreed.

      I've been experiencing a lot of page loading and freezing issues in the Consumer Preview as well. The fact that they seem to be still there in the Release Preview (which I didn't check out so far since I turned back to Windows 7 after using the CP for a while) is not a good sign. It's too bad that we never got an updated Platform Preview, a Beta, or Release Candidate for Windows versions prior 8. From what I can tell, the reason seems to be the deep integration of browser components into the operating system (in the Consumer Preview, for example, you could notice that from the scrollbars and controls in the IE frame as they were Metro-style even in the Desktop version). And simply exchanging the files of the Platform Preview 2 with later versions (like you could do for PP versions of IE9) didn't work either since, at least for now, there are quite a lot of dependencies to the Windows Runtime.

      I still hope we'll get the same and full IE10 experience for Windows 7, and not exclusively on Windows 8. Personally, I won't upgrade to Windows 8 just to get it. The overall benefits of this operating system are too little, the deprivations yet too many.
      • I've always noticed issues with IE

        There are just some areas in which IE can't keep up, regardless of it's development status (beta, release candidate, final).

        For example, anchored backgrounds (backgrounds with images that don't move as you scroll) are extremely slow. IE stutters when I scroll on such pages. Google Chrome, Firefox, et al, have no problems with the same exact pages at all. They don't skip a beat.

        Then there is an issue with huge web pages. Internet Explorer is also (in my experience, I will note) very bad at handling very long web pages. Just as with stationary backgrounds, IE stutters and in certain cases freezes with large web pages. It just chokes.

        Once again, every other browser doesn't experience any of these issues.

        If those weren't issues, IE wouldn't be that bad, yet they would still lag behind. Microsoft develops it so slowly that, in comparison to others, it's just a basic browser (horrible extension support -- they slow down the browser, missing features [where's syncing? why are there so few importing options from other browsers?]).

        It just sucks, that is all...
      • I guess mileage varies

        @ian.aldrighetti: I find FireFox has issues handling long pages, and stationary backgrounds work fine in IE and FF.
    • IE10 final version

      The DOM manipulation of Trident. When it comes to live DOM, Trident seems to be very slow. Same things happen while working with live cells in Excel's VBA macro. Are they related? The page load has nothing to do with the live DOM? or it has everything to do with the live DOM?

      There is a BIG difference between IE10RP and IE10RTM (and even the coming IE10 GA) when it comes to performance of DOM manipulation. If you were following the issue at Microsoft-connect, you might have seen this one

      For particularly page loading, just open this page in IE8, IE9, IE10 RP and then IE10RTM and compare. There you will find lot of improvements..
  • IE10

    10 is noticeably faster. Have used it on CP8.
    Not scientific , but looks faster than Chrome/FF/9 on W7.
    In short , IE10 is BLAZING fast.
    What does MJF use ?
  • IE

    I`m going to tell Paul if you don`t use IE : )
    • He already knows

      Pretty sure Mary Jo has said this on Windows Weekly before ;)
  • about the old sites

    What old web sites exactly are much slower in IE9 than in Chrome, for example?
  • back in the day

    remember when MS was against java scripting and fought it at every angle. Still not sure how they can seem innocent and walk away from their other scripting.
  • IE9 is slow, jerky and rubbish...

    ... so why should IE10 be any improvement if it's based on IE9. It took me 15 minutes to find "History". Jeez! Micorsoft should leave the browser market to the professionals - Chrome, Opera, Safari and Firefox.
    Graphic Equaliser