Slashdot Mirror


Microsoft's JavaScript Engine Gets Two-Tiered Compilation

jones_supa writes: The Internet Explorer team at Microsoft recently detailed changes to the JavaScript engine coming in Windows 10. A significant change is the addition of a new tier in the Just-in-Time (JIT) compiler. In Windows 10, the Chakra JS engine now includes a second JIT compiler that bridges the gap between slow, interpreted code and fast, optimized code. It uses this middle-tier compiler, called Simple JIT, as a "good enough" layer that can move execution away from the interpreter quicker than the Full JIT can. Microsoft claims that the changes will allow certain workloads to "run up to 30% faster". The move to a two-tiered JIT compiler structure mirrors what other browsers have done. SpiderMonkey, the JavaScript engine in Firefox, has an interpreter and two compilers: Baseline and IonMonkey. In Google Chrome, the V8 JavaScript engine is also a two-tiered system. It does not use an interpreter, but compiles on a discrete background thread.

46 comments

  1. So in other words . . . by UnknowingFool · · Score: 0, Flamebait

    Internet Explorer is still playing catch up with other browsers.

    --
    Well, there's spam egg sausage and spam, that's not got much spam in it.
    1. Re:So in other words . . . by Anonymous Coward · · Score: 2, Funny

      Would you rather they didn't? You'd get to be smug either way, it seems.

    2. Re:So in other words . . . by Sloppy · · Score: 4, Insightful

      You say it dismissively, but the big thing lately is that Microsoft can play catch-up and is really trying to do it. Did you ever think you'd see the day? Starting around MSIE 9 they made huge strides toward becoming fairly normal, rather remaining forever obsolete, as a weird, special, anachronistic case. You never would have heard anyone say this in 2009 or 2004 but it now looks like a fresh Windows install might be able to surf the web, right out-of-the-box.

      It used to be that if someone had problems and you found out their browser was .. well, they didn't know, but they said they just "clicked the internet" .. you'd tell 'em they need to get a browser, any reasonably modern browser. But I rebooted to do some testing just yesterday, and MSIE 11 does not suck. Seriously, I found more problems with Safari on Windows, than I did with MSIE.

      Today's web browsers, in general, are pretty damn good. Even Microsoft can do this now.

      --
      As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
    3. Re:So in other words . . . by ArcadeMan · · Score: 2

      The Windows version of Safari has not be updated in forever (browser time), you can probably drop "Safari Windows" from your testing list.

    4. Re:So in other words . . . by Rob+Y. · · Score: 1

      I wonder who has the patent on 'two-tiered' just in time compilation...? You'd think it's worth at least as much as FAT32.

      --
      Posted from my Android phone. Oh, I can change this? There, that's better...
    5. Re:So in other words . . . by gsnedders · · Score: 1

      You say it dismissively, but the big thing lately is that Microsoft can play catch-up and is really trying to do it. Did you ever think you'd see the day? Starting around MSIE 9 they made huge strides toward becoming fairly normal, rather remaining forever obsolete, as a weird, special, anachronistic case. You never would have heard anyone say this in 2009 or 2004 but it now looks like a fresh Windows install might be able to surf the web, right out-of-the-box.

      I dunno, I heard plenty of people saying it in 2009, especially around specs circles (both around WHATWG/W3C groups and those around implementers doing evangelism work), even if whenever it was voiced it got laughed at by most web devs. In reality, it was very obvious that IE7 was mostly just trying to quickly fix what they thought were the biggest shortcomings of IE6 (which, after all, hadn't really been touched in years, and most of the dev team didn't have any idea about the codebase); IE8 followed on making pretty significant low-level changes that were pretty obviously designed at making many of the modern parts of the web platform easy to implement (from what's been said, it should definitely be the case that many CSS modules nowadays are easier to implement in modern IE than in other browser engines, simply because they rewrote so much for IE8), even though ultimately it shipped more or less at feature parity with IE7 (albeit with fewer bugs). IE9 was when all that work started to come together, starting to add large amounts of the more modern parts of the web platform.

    6. Re:So in other words . . . by sydbarrett74 · · Score: 1

      Agreed. And the fact that IE12 will have a new extension engine finally puts it at feature parity with Chrome and Firefox. Microsoft is getting back in the game, and Apple seems to be coming out with ho-hum, me-too tweaks of existing products rather than anything truly new. Stuff happens in cycles. That's what keeps things exciting.

      --
      'He who has to break a thing to find out what it is, has left the path of wisdom.' -- Gandalf to Saruman
  2. What? by Anonymous Coward · · Score: 0

    What's Internet Explorer? Never heard of it.

  3. That's great by ArcadeMan · · Score: 1

    But as usual, the latest version of Internet Explorer won't be available for older versions of Windows, meaning we'll have to keep supporting Internet Explorer 7+ for another decade or so.

    1. Re:That's great by Richard_at_work · · Score: 2

      Why IE7? IE9 is the highest version of IE that will run on Vista, which is the lowest currently supported version of Windows.

    2. Re:That's great by ArcadeMan · · Score: 1

      Is there anyone out there choosing to run Vista instead of Windows 7?

      What's the highest version of IE that will run on Windows 7?

    3. Re:That's great by Shados · · Score: 2

      Even many very large e-commerce sites dropped IE7 now, as it accounts for a very small amount of sessions, and an even smaller amount of conversion. Software engineers are expensive, and you need a lot to maintain a moderately complex website/app that supports IE7.

      IE8 is a little more awkward. If your target audience is the general public (again, ecommerce site selling stuff to a general audience), you'll have to support it. If, however, you have a more sophisticated product (let say you target a more professional user base), you generally can get away with only supporting IE9 and up (ie: thats what Amazon EC2 does i beleive).

      And if you develop an actual specialized web "app" that you license to a small group, something that will only be used internally by a few users, let say an HR management software or an ERP, you can have pretty constrained supported browser lists. This is where you can start wiping out the "Firefox/Chrome edge or IE10+". Developing with only green browsers as targets is pretty nuts. Lots of features you've never thought about become available. You can have offline mode because of local storage, webGL can be assumed, performance is rarely an issue, you pretty much don't need librairies like underscore anymore to do functional stuff because Array.prototype has most of it...

      Fun stuff.

    4. Re:That's great by Anonymous Coward · · Score: 0

      All versions of IE run on Windows 7. Windows 7 is still in mainstream support. Why are you still running IE7?

    5. Re:That's great by gstoddart · · Score: 1

      Is there anyone out there choosing to run Vista instead of Windows 7?

      LOL, well, there's me, but I might be the only one. :-P

      I've found upgrading Windows over the years more annoying than buying an entirely new machine, and I've been happy with my Vista machine.

      Of course, I don't actually use IE, so I have no idea of what version I've got. Except for work machines, I try not to use IE.

      --
      Lost at C:>. Found at C.
    6. Re:That's great by freezin+fat+guy · · Score: 1

      Firefox

    7. Re:That's great by quetwo · · Score: 2

      Of course, our HR and ERP systems took the exact opposite approach. They only support IE6.5 through IE8, or Firefox 14 - 19. Of course, they also force us to have Java 1.6 still installed because while their app runs on Java 1.7 and 1.8, they do some version checking and artificially block it.

    8. Re:That's great by psmears · · Score: 2

      Vista, which is the lowest currently supported version of Windows.

      That's actually not true, strictly speaking... XP is still supported, for those (usually governments and large companies) who are willing to pay Microsoft for it...

    9. Re:That's great by DrStrangluv · · Score: 1

      IE7 is already dead. The only supported system that still has it by default is Vista. Vista already has such poor market share, and even most of those users are running IE 9.

      With XP now officially end of life, it's reasonable to expect users to be running at least IE 9 now.

    10. Re:That's great by Shados · · Score: 1

      Yeah, especially older ("more mature") systems tend to have those restrictions, because ERP developers usually prioritize "crossing the checkboxes" (ie: feature bloat) over good engineering. There's a few that have more forward thinking approaches...

    11. Re:That's great by Anonymous Coward · · Score: 0

      Is there anyone out there choosing to run Vista instead of Windows 7?

      What's the highest version of IE that will run on Windows 7?

      At least 11

    12. Re:That's great by master_kaos · · Score: 1

      maybe, but the unfortunate thing is real life doesn't work that way just because microsoft says so. We have customers still using XP (usually older people, or government employees) so unfortunately we have to still support ie6. So what we do is support our core apps for ie6 but any new features/new apps we only support ie9+

    13. Re:That's great by terjeber · · Score: 1

      Firefox? Seriously? Is anyone still using that bloated piece of shit?

  4. Will it be reusable? by AqD · · Score: 2

    For node.js and/or .NET apps on Windows?

    It'd seem like a waste of effort if the shiny JS engine can only be used within IE. IE is dying anyway and they could save tons of money by embedding WebKit instead.

    1. Re:Will it be reusable? by Wootery · · Score: 2

      IE is dying anyway and they could save tons of money by embedding WebKit instead.

      MS are way too proud to do that. Anyway, I'd far rather IE just be well-maintained and keep some variety in the web: a 'monoculture' world of WebKit (well, and Gecko) isn't good for the web.

    2. Re:Will it be reusable? by Anonymous Coward · · Score: 1

      I just wish the Opera people would open source Presto.

    3. Re:Will it be reusable? by Anonymous Coward · · Score: 0

      Chakra can be (and is!) used outside of IE. I've heard Microsoft Open Technologies has even investigated what it would take to rehost node.js on top of Chakra instead of V8.

      Example:

      https://code.msdn.microsoft.com/windowsdesktop/JavaScript-Runtime-Hosting-d3a13880

  5. Tired? by Geeky · · Score: 1

    I just misread the title as "Microsoft's JavaScript Engine Gets Two-Tired Compilation.

    --
    Sigs are so 1990s. No way would I be seen dead with one.
    1. Re:Tired? by lgw · · Score: 1

      Wouldn't that be "too tired compilation"?

      --
      Socialism: a lie told by totalitarians and believed by fools.
  6. Razors by Mikkeles · · Score: 5, Funny

    I can see this going the same way as number of shaving blades on a razor with 5 tiered JIT js.

    --
    Great minds think alike; fools seldom differ.
  7. Re:M$ keeping it cutting edge by Wootery · · Score: 1

    It doesn't seem fair to laugh at them for being late to adopt this particular technique.

    What really matters is the overall performance, compatibility, etc.

    Two-tiered compilation has pros and cons, it's not a silver bullet.

  8. Safari: four tiers by gdp007 · · Score: 2

    Safari offers *four* tiers with their FTL (Fourth Tier LLVM). Lots of detail here: https://www.webkit.org/blog/33....

    1. Re:Safari: four tiers by wonkey_monkey · · Score: 2

      Fuck everything, we're doing five tiers.

      --
      systemd is Roko's Basilisk.
  9. Given that the mobile world has moved to apps... by Viol8 · · Score: 0

    ... I'm not really sure why so much effort is being put into fine tune browser performance when most browsers simply get used to display pretty static web pages. The number of people who actually play heavy duty games or anything that requires realtime performance in a browser is probably miniscule and any real gamer will be using .exe's.

    Perhaps if browsers were kept simple rather than this constant effort to try and make them replace the desktop as a one-app-runs-all enviroment there wouldn't be so many exploits and they wouldn't be bloated bug ridden monstrosities.

  10. An other step in the right direction by Sla$hPot · · Score: 0

    Looks like the year 2015 will mark the revenge of the web.
    With an all-round browser support of asm.js, the road is paved for all kinds of heavy duty apps running in your favorite browser.
    Hopefully MS is not just considering asm.js for Chakra https://status.modern.ie/asmjs

  11. Windows Embedded Piece of $#!+ Ready by tepples · · Score: 1

    You are correct about desktop Windows, but Windows Server 2003 and Windows Embedded POSReady are still in extended support. There are already registry hacks to make Windows Update think Windows XP SP3 is POSReady.

  12. Re:Given that the mobile world has moved to apps.. by Anonymous Coward · · Score: 0

    >I'm not really sure why so much effort is being put into fine tune browser performance when most browsers simply get used to display pretty static web pages.

    Are you saying that most browsers, most meaning more than half of them, do NOT encounter dynamic pages? I don't believe that for a second.

    Anyway the browser definitely is becoming more and more an app environment. You can't stop the train.

  13. WebGL disabled due to unresolved driver issues by tepples · · Score: 1

    webGL can be assumed

    Not necessarily. A lot of integrated graphics processors in (especially older) office PCs don't support a high enough OpenGL version for WebGL to work. For example, when I visited http://get.webgl.org/ using Firefox 32 on my laptop, it said that though the browser supports WebGL, it is currently disabled. Then I checked about:support and it said it was disabled due to unresolved driver issues. (Not exact wording because that computer isn't in front of me right now. I can retrieve the exact wording on request.) A bit more research turned up the Atom N450's HD Graphics 3100 IGP supporting only OpenGL 1.4, which was before the big reorganization of the OpenGL API to deprecate the fixed-function pipeline.

    1. Re:WebGL disabled due to unresolved driver issues by Shados · · Score: 1

      You took that out of context and read too much into it. My statement wasn't only about targeting newer browsers, but when you have some form of control over a small, focused user base.

      If your target audience is data scientists in big companies (that was the scenario i had in mind, based on a real product we shipped), 99.9 (I almost want to say 100%) of our target audience (a few hundreds users across a couple companies) was running less than 2 years old Macbook Pros. That worked quite nicely.

      Sure, once you start growing and widening your target audience you'd start needing some kind of fallback...but the way we saw it, it was like if you were making 3d Studio Max or Maya or whatever... you can assume a certain level of hardware from your users.

    2. Re:WebGL disabled due to unresolved driver issues by tepples · · Score: 1

      You'd be surprised how many businesses insist on continuing to use older, paid-for PC hardware. That's why WinFLP was created: to get businesses off Windows 98 and onto the XP kernel. And some of this hardware won't be able to use WebGL.

  14. Re:Given that the mobile world has moved to apps.. by NotInHere · · Score: 1

    Browsers are the most secure and privacy preserving way today to execute programs on your computer. They maintain a clear separation between the data on your HDD and theirs, if they need access to your camera they ask you, and it has become really hard to develop an exploit to break out of this sandbox. Because of xkcd 1200, I usually avoid using closed source apps on my desktop, but inside a browser I know it doesn't steal my data, or break something else in my system. Do you remember all those "splash screens" that appeared when you have logged in, advertising some bloaty software? In the browser there are no splash screens. I know, app stores also ensure standards and such, but browsers are still better, as they ensure basic features (copy text, ctrl f etc) I need in everyday computer use.

  15. Re:Given that the mobile world has moved to apps.. by NotInHere · · Score: 1

    Except the fact that browser programs are always-online of course.

  16. Will it be reusable? by Anonymous Coward · · Score: 0

    "For node.js and/or .NET apps on Windows?"

    IE/Chakra are already used for modern WinRT-based apps so the partial answer to your question is "yes".

  17. Offline web applications by tepples · · Score: 1

    Except the fact that browser programs are always-online of course.

    They were until HTML5 introduced "application cache", "local storage", and "IndexedDB" features. This has allowed for offline-first design.

  18. Re:Given that the mobile world has moved to apps.. by master_kaos · · Score: 1

    yeah I don't know what you are talking about. As I would say 99.9% of the internet ISN'T static web pages. I just did view source on this page, and 1/3 of the content is JS.