Slashdot Mirror


Revamped WebKit JavaScript Engine Doubles In Speed

Shin-LaC writes "In a post on their official blog, WebKit developers introduced the 'next generation' of their JavaScript engine, SquirrelFish Extreme, claimed to be twice as fast as its predecessor. The post lists several changes contributing to the performance improvements, including 'bytecode optimization,' a 'polymorphic inline cache' (which sounds similar to V8's 'hidden class transitions'), and a 'context threaded JIT' compiler which generates native code (currently only for x86 processors), and is also applied to regular expressions. The new JavaScript engine is already available in the latest WebKit nightly builds. According to comparative benchmarks, the new engine is around 35% faster than the V8 engine recently introduced in Google Chrome, and 55% faster than Mozilla's TraceMonkey."

35 of 270 comments (clear)

  1. Faster = more memory? by Starmengau · · Score: 2, Insightful

    One of the things we've seen in the past few releases of any browser is that new features seem to increase the already monumental footprint of current web browsers. As far as I've seen, JIT compilers use a whole freaking lot of memory. While I suppose this is acceptable for the whole "Web 2.0 means the web is the only useful thing on your PC!" crowd, I'd like to have a few (3 or 4)browser tabs open while I'm playing a game, for example, without the browser killing my gaming experience.

    1. Re:Faster = more memory? by martinw89 · · Score: 5, Insightful

      No, I will not get off your lawn. Space/speed is a tradeoff. At the moment, we have even bottom of the barrel desktops selling with large amounts of memory. With the eventual rise of 64 bit, expect the amounts to go up even more. There's no reason to avoid taking advantage of this. What's the point of having this huge (seriously, look at the memory difference from now and 10 years ago) amount of memory to just let it sit there, save the occasional multimedia editing task?

      As for your game, it seems to be using quite a huge chunk of memory as well. You know, one of the things we've seen in the past few releases of any modern 3D game is that new features seem to increase the already monumental footprint of current games. And hell, I'm using my browser at least 10 times longer a day than I'm playing a game. I want my browser to be snappy, I don't mind not visiting Super Ultra JS Web App 3.6 if I'm going to be playing a resource intensive game. In fact, I probably wouldn't be using my browser at all anyway.

      But that last paragraph is just my personal experience, YMMV

    2. Re:Faster = more memory? by Anonymous Coward · · Score: 5, Insightful

      Anyone using the term "gaming Experience" deserves to have it ruined.

    3. Re:Faster = more memory? by jsebrech · · Score: 4, Insightful

      Every day we see more and more JavaScript exploits out in the wild,and yet the only thing anyone seems to be concerned with is speed?

      Those aren't javascript exploits, they're security issues in other parts of the code that are easiest to trigger via javascript, and that you will resolve with proper sandboxing, which all browser makers are working on. Exploits in pure javascript are pretty rare.

      I think we're talking about a trade-off between usefulness and security anyway. Disabling javascript to gain security is a bit like putting foam on the end of a hammer to avoid hurting your thumb. It sort of misses the point.

  2. Competition by Per+Wigren · · Score: 3, Insightful

    This is a wonderful example of what happens when there are open standards and healthy competition! The consumer is the winner!

    --
    My other account has a 3-digit UID.
    1. Re:Competition by Billhead · · Score: 5, Insightful

      Just because NoScript users are loud doesn't make them a majority.

    2. Re:Competition by Bill,+Shooter+of+Bul · · Score: 4, Insightful

      I use NoScript as a javascript firewall. No stupid javascript from sketchy sites lined to in slashdot stories or random blogs. I don't trust their javascript any more than I trust the editors to edit. Wait, actually I trust it less than slashdot editors to edit.

      --
      Well.. maybe. Or Maybe not. But Definitely not sort of.
    3. Re:Competition by willyhill · · Score: 2, Insightful

      I hear even Microsoft is getting into the game with IE8, supposedly the script engine on that one is much faster than the IE6/7 one, almost on par with FF2.x.

      Long gone are the days of stagnation. Competition is good, let's embrace it and be happy about it instead of complaining (as some people seem to be doing here) about the memory footprint and whatnot.

      Maybe soon the browser will become a viable platform for application delivery, which Netscape promised us back in the early 90s.

      --
      The twitter monologues. Click on my homepage and be amazed.
    4. Re:Competition by lilomar · · Score: 4, Insightful

      Exactly NoScript doesn't really mean No-Scripts, it means No-Scripts-I-Don't-Explicitly-Allow. Just because I don't want anyone with a website to be able to run whatever they want on my box, doesn't mean that I don't ever use JS.

      --
      The creator of this post (Jacob Smith) hereby releases it, and all of his other posts, into the public domain.
  3. Really interesting work by Tragek · · Score: 2, Insightful

    I really am loving this JS engine war; I don't program JavaScript, and know nothing about JIT, but having read more than my fair share of compiler optimization and analysis papers, it's really good to see that compiler tech and research is alive and kicking.

    1. Re:Really interesting work by Spy+der+Mann · · Score: 2, Insightful

      Yeah, except that it's JavaScript, traditionally one of the slower languages because it's objects are basically hashtables.

      And php stores its variables.... how?

    2. Re:Really interesting work by dgatwood · · Score: 2, Insightful

      And Perl stores its classes how?

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    3. Re:Really interesting work by Anonymous Coward · · Score: 1, Insightful

      The reason the current crop of dynamic languages are slow is not technology, it's lack of manpower and/or willingness. Smalltalk and Lisp implementations were tuned into damn fast interactive compilers (which is not quite the same thing as JIT) back in the 1970's and 80's when Smalltalk and Lisp were relatively popular and they had multiple competing commercial vendors.

      However popular python, perl and php are, there simply doesn't seem to be sufficient interest to develop a fast dynamic compiler and make it fully supported. There have been multiple projects to make smart python compilers, but the mainstream python implementation community stays behind the slow interpreter which is where all the language and library development happens. Thus the python compilers (ShedSkin, PyPy, IronPython and whatever else there is) have fallen behind and never managed to get to production level.

      Then there is the parrot JIT virtual machine project for perl, which may actually get finished any decade now. I don't know if it's manpower they lack, or if it's the second-system effect in action. As for PHP, I haven't followed developments there.

      Javascript is an interesting case - it has become mainstream enough that there is sufficient commercial interest to make the main implementations JIT compilers. Perhaps the important difference to perl and python is that Javascript is defined by workable (although not perfect) standards and there are multiple competing implementations instead of a single interpreter. Or maybe it was just a question of sufficient need and funding producing the required push and manpower.

      Whatever the reasons javascript is making the transition, I don't see perl, python or PHP in the same position to take advantage of them. All of the latter are still defined by a single major interpreter implementation, and don't have the kind of backing javascript has.

  4. Re:Tracemonkey is slower than V8? by Anonymous Coward · · Score: 3, Insightful

    He who controls the test suite, controls the outcome.

  5. Small test by Anonymous Coward · · Score: 1, Insightful

    Have a webapp that uses Extjs, and does some pretty hefty DOM manipulation. A small test on it just now, and firefox 3 still smokes the latest webkit on it by a very wide margin.

  6. Re:Open standards, healthy competition, free softw by Per+Wigren · · Score: 2, Insightful

    The LGPL and BSD licenses are "free as in beer" now?

    --
    My other account has a 3-digit UID.
  7. Re:That's great! by Niten · · Score: 3, Insightful

    I had a feeling someone would use this as a JavaScript-bashing opportunity. After all, JavaScript is the world's most misunderstood programming language.

  8. Re:Open standards, healthy competition, free softw by MightyYar · · Score: 3, Insightful

    I never quite got how its a wonderful thing when Apple and Google cross-subsidize free-as-in-beer Internet browsers but when They Who Must Not Be Named do the same thing its evil, monopolistic, anti-consumer behavior.

    I can understand thinking it's not evil or anti-consumer... but c'mon - monopolistic? It's the very definition! A monopoly isn't illegal - using it to gain an advantage somewhere else is. Apple, with their pathetic little market share is not even close to a monopoly. Even their iPod is only like 70% of the market. Google has a near-monopoly on search - but how they are using that to gain an advantage via a web browser is pretty questionable. It's not like you have to use their browser to search or something - they don't even promote it on their home page.

    --
    W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
  9. Re:Javascript by MightyYar · · Score: 3, Insightful

    it seemed that it was only used for pop-ups and advertisements.

    No, no... it was also used to invade your privacy.

    --
    W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
  10. Re:Speed of JS engine matters why? by bunratty · · Score: 4, Insightful

    For the next generation webapps that web developers haven't been able to write because JavaScript has been too slow until recently.

    --
    What a fool believes, he sees, no wise man has the power to reason away.
  11. Q! by AKAImBatman · · Score: 5, Insightful

    I never quite got how its a wonderful thing when Apple and Google cross-subsidize free-as-in-beer Internet browsers but when They Who Must Not Be Named do the same thing its evil, monopolistic, anti-consumer behavior.

    You know what I can't believe? I can't believe this crap got modded up. Talk about a disingenuous argument if I ever saw one.

    Call me when:

    • Microsoft can meet standards they helped develop. You know, simple things like DOM2.
    • Microsoft shows an actual interest in progress by supporting the WHATWG rather than rolling out Yet Another Proprietary Platform(TM) like Silverlight.
    • Microsoft actually listens to the REAL problems developers are having in their "Open" development process. Best quote I've heard so far? "I tested IE8 the other day and was unable to remove a single [standards support] hack."
    • Microsoft doesn't cram their browser down your throat with artificial desktop integration
    • Microsoft has their source code for IE available for download
    • Microsoft actually accepts patches for their browser

    If Microsoft did even HALF of that you could act all high and mighty. But from where I stand, you're just another Microsoft shill. Be gone!!!

  12. Re:Open standards, healthy competition, free softw by Bogtha · · Score: 5, Insightful

    I never quite got how its a wonderful thing when Apple and Google cross-subsidize free-as-in-beer Internet browsers but when They Who Must Not Be Named do the same thing its evil, monopolistic, anti-consumer behavior.

    History lesson for people tempted to fall for this troll:

    Once upon a time, people sold browsers just like they sold any other piece of software. Netscape were making money licensing their browser for corporate environments. The web, and consequently its leader, Netscape, threatened Microsoft's desktop monopoly. So Microsoft used all the cash they had from selling desktop operating systems, bought a web browser (defrauding that company in the process) and spent lots of money developing it further. Then they gave it away for free, at a massive loss to themselves, to "cut off Netscape's air supply". Still, that wasn't enough to unseat Netscape, so Microsoft went further and bundled it into their operating system too. Now all of a sudden 95% of the people on the planet had Microsoft's browser whether they liked it or not - and Netscape were basically dead.

    Microsoft were able to eliminate the competition not because they offered a better product, but because they had a dominant position in another market and were willing to dump their product on the market no matter the cost, to put another company out of business. This is not how capitalism is supposed to work. The free market cannot deal with this situation well. The invisible hand is tied behind its invisible back. So in many countries, abusing a monopoly position in this way is illegal. And that's why Microsoft is vilified here - because they acted like bullies, took something dear to geeks, and shat all over it to make money.

    Now that browsers are a commodity, how are Apple and Google harming the browser market with anticompetitive actions? Answer - they aren't. They are actually competing by providing better products. And that's why it's completely different to what Microsoft did.

    --
    Bogtha Bogtha Bogtha
  13. Re:Google... by Darkness404 · · Score: 4, Insightful

    Replace Google with any standards-supporting, partially open source vendor and you have the current market situation. Heck, if WebKit manages to somehow run JavaScript at twice the speed of assembly programs, Mozilla can still take that code and make Gecko's JavaScript engine just as fast. If Red Hat releases a tool that can run all Windows applications at full speed on Linux, Novell and Canonical don't lose out, they gain too, in that example even the WINE and ReactOS team could gain something. It is only the proprietary vendors that lose whenever the competition gets a new feature. Only IE and Opera that can't tap into these new JavaScript engines. It helps every open source browser project, from Firefox to Konqueror, to Chrome, to even Safari. It is only the few that remain closed that this will hurt.

    --
    Taxation is legalized theft, no more, no less.
  14. Re:Message to Google by neokushan · · Score: 2, Insightful

    That's a very good...pile of FUD right there.

    Lets see here, you're pretty much saying that if you use Linux, you'll simply KNOW when something is up with your system, but if you use windows, you wont because you'll think it's just some sort of update Microsoft is pushing on you? What about the average Mac user, do you honestly think they're "Technically-inclined" when the entire marketing campaign Apple uses can be summed up as "Buy a Mac - because it'll make you cool"? Or what about all those people who just bought an Eee PC (or similar) because they're affordable and all the rage? Will they suddenly become experts overnight and know the ins/outs of linux, at least enough to know when it's doing something it's not supposed to?
    Besides, when was the last time you seen Windows Update automatically install a new toolbar or whatever? The only thing I can think of in recent memory was the new Live search thing and I'm sure that was an OPTIONAL download anyway (and anyone that just ticks all the boxes and downloads anything they see without reading about what they're getting is just asking for trouble). Even IE7 is optional. Everything else is just security/program updates, with the exception of the odd service pack (which is what, once every 2 years?).
    Plus, it's not like modern Linux distributions don't have their own update programs within them, particularly those designed for the novice user. How are they going to know that their fancy new toolbar isn't just something linux has?

    Your advice to the above poster is possibly the worst advice you could ever give anyone - "Use this OS and you'll be safe!". That's a load of bull, it just takes one person to make a virus and/or Trojan targeting that OS and your complacency will be taken complete advantage of because "you're running linux - YOU'RE SAFE!". The best way to ensure your system doesn't get compromised is to be careful and vigilant, which is exactly what the OP is, then even the "few" script kiddies that actually do target you will be hard pushed to hax0r your b0x0r.
    Yes, it's a minor inconvenience, but it's the ONLY way to be absolutely sure you're safe. And yes, this even works on WINDOWS boxes. Shocking, I know.

    I hate defending Microsoft, but I hate it even more when people bash them for all the wrong reasons, or use feeble excuses - at least have a go at them for something genuine, it's not like you haven't got much to pick at them with.

    --
    +1 IDisagreeSoHeMustBeATrollOrAnAstroturferOrAShill
  15. The invisible hand is working just fine by SuperKendall · · Score: 1, Insightful

    This is not how capitalism is supposed to work. The free market cannot deal with this situation well.

    The free market has been dealing with it, and is slowly cutting Microsoft browser marketshare down to a size where they too must adhere to standards.

    I don't see why everyone thinks a free market MUST fix everything instantly. It's all about the long term. Even when a company like Microsoft becomes dominant, you can see that over time they simply become irrelevant and other companies can eventually wear them down.

    And of course, it's not like we have a completely open market anyway - there's a lot of regulation going on in our "free" market.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  16. Re:Message to Google by Spy+der+Mann · · Score: 4, Insightful

    Your advice to the above poster is possibly the worst advice you could ever give anyone - "Use this OS and you'll be safe!". That's a load of bull, it just takes one person to make a virus and/or Trojan targeting that OS and your complacency will be taken complete advantage of because "you're running linux - YOU'RE SAFE!".

    Hmmm... right, and wrong.

    You (and also the GP poster) have fallen for the "Linux isn't hacked because it's not the majority" straw-man. Linux is much harder to hack because it provides a much better security than Windows. For starters, you can run your software as non-root! And for any installation you actually have to provide a password. Compared to the Vista "Cancel, Allow" prompts, this is much better, because people unconsciously hit allow because they get trained (by Vista) to do that. Also, GNU/Linux does not have unknown services enabled by default.

    Also, when the GP says that Linux users know something's wrong because they have an extra toolbar, he's right. If I have an extra toolbar on Firefox that I didn't install, i'm not just in trouble. I'm in DEEP trouble and I can almost guarantee that someone pwned my PC (or at least my user account). This is a question of knowledge, granted, but Windows users who have NO IDEA of what's going on inside their OS, just say "oh well, I'll just have to get accustomed to it". And the worst part: they DO get accustomed to it! It's like the battered wife syndrome, but with viruses.

    Also, Microsoft products are prone to have security holes because their software is not open source (many eyes make bugs shallow). Open Source software gets updated almost the day after when a vulnerability is discovered.

    Finally, MS products are also prone to have security holes because since the old MS Word days they keep mixing data with code. First there were the Word Viruses, then the Excel Viruses, then the e-mail viruses, and thanks to ActiveX, webpage viruses. And if that wasn't enough, we got WMV viruses, MP3 viruses (which are possible thanks to stupid security policies like not warning you when the filetype is actually different than the extension reported), and don't get me started with autorun.inf viruses in USB drives.

    They never learn!

    So, yes, GNU/Linux is more secure per-se than Microsoft Windows. That's a FACT. And yes, it's also more secure because GNU/Linux users are more careful.

  17. Re:That's great! by Anonymous Coward · · Score: 1, Insightful

    Nevertheless, Javascript implementations suck pretty hard and that is why all of the various groups are able to show such huge performance improvements.

  18. Re:Google... by jesser · · Score: 4, Insightful

    If the license is permissive (like the MIT license), Opera and IE can incorporate the new code just as easily as open-source browsers can. If the license if open-source but not especially permissive (like the GPL), Opera and IE can't use it, but neither can many other open-source projects.

    As it happens, V8 is BSD, Tracemonkey is LGPL+MPL+GPL, and SquirrelFish is LGPL+BSD. I believe BSD and MPL are both permissive enough for use in Opera and IE.

    --
    The shareholder is always right.
  19. Re:That's great! by Anonymous Coward · · Score: 3, Insightful

    ... until the age of monolithic libraries like MFC and OWL (and now things like the JDK and .Net) came and ruined that fun by restricting your freedom. If there's one thing that will make me buy into the whole browser-as-OS thing, it's an efficient, bare-bones and flexible Javascript implementation, kind of like programming in C for your browser.

    Bullshit.

  20. Re:Open standards, healthy competition, free softw by Anonymous Coward · · Score: 3, Insightful

    > gave it away for free, at a massive loss to themselves,

    Microsoft had Spyglass write IE for them and the deal was that Spyglass would get $5.00 for every copy that MS sold. MS then gave it away and thus nothing was ever paid to Spyglass.

    There was certainly no "loss to themselves".

    They did also pay various OEMs $5.00 a time to _not_ install Netscape. Or specifically it was a $5.00 discount on the price of Windows if Netscape was not installed, so that was a cost to MS.

    The former was immoral, the latter was probably illegal.

  21. Re:Amazingly, everyone is faster than everyone els by BZ · · Score: 2, Insightful

    Bingo. What it comes down to is that the answer to "Is X faster than Y" will depend on two things:

    1) The benchmark
    2) The day of the week (or the exact, to the minute builds you're testing, if you prefer)

    The reason for the latter is that all three are in active development. Each one is doing measurements right after landing major changes, against whatever the current state of the other two is. That means that there is inherent bias there in favor of whoever is doing the measurements being fastest: they've just hopped a step up in performance while the other two engines are on the same step they were at 3 minutes ago.

    The same thing will happen with stable releases, for what it's worth. Safari 3 shipped a faster JS engine than Firefox 2. Then Firefox 3 shipped faster than Safari 3. We'll see what the ship dates for Safari 4 and Firefox 3.1 or whatever look like, but I suspect tat if things continue as they are each will be the fastest shipping stable thing at ship time.

    Which is more or less what you said, I guess. ;)

  22. Re:That's great! by try_anything · · Score: 4, Insightful

    I remember when C/C++/ASM programming was fun to hack, until the age of monolithic libraries like MFC and OWL (and now things like the JDK and .Net) came and ruined that fun by restricting your freedom.

    How do libraries and application frameworks restrict your freedom? Your boss makes you use them? Sorry, I don't follow your argument at all. If you want to write your own socket library, regular expressions library, and logging framework, go ahead and do it. Nobody's stopping you.

    If modern amenities have made you bored with programming, I suggest attacking a problem domain that hasn't yet been made trivially easy. Get a four-core box and convert a single-threaded application into one that uses all four cores efficiently. That's something that Java and .NET won't solve for you. Whenever one problem is rendered trivial by Moore's law or by some helpful library author, there is always a bigger problem to tackle.

  23. Re:That's great! by operator_error · · Score: 2, Insightful

    OK, I know you're going to call me an old curmudgeon, but where can I run your Cocoa code? Pretty much all the customers in my market use Windows, but might be open to Linux. And we're all focused more heavily on servers too. New Apple hardware is going to be a tough sell too.

    At least with javascript, I can expect a universal, albeit lowest-common-denominator client-base.

  24. Re:That's great! by STFS · · Score: 4, Insightful

    Please mod parent up, it's true, this is bullshit! Monolithic libraries in C++ restrict your freedom? How in the world do you get to that conclusion? FYI, almost nobody uses MFC, and if it bogs you down, well duhhh... don't use it! C++ is almost exactly the way it used to be, the language hasn't changed at all. You can still do everything by hand like you used to if that's what you want. The "monolithic" libraries you speak of tend to help the rest of us get things done and I for one, welcome a more diverse selection of these.

    --
    You don't think enough... therefore you better not be!
  25. Don't use Noscript! by YA_Python_dev · · Score: 2, Insightful

    JavaScript in Firefox is (almost?) never the source of security problems in the real world. If Noscript stops something is only because an exploit in another component also uses JavaScript (and often only because the person writing the exploit code was lazy).

    Try disabling Java and deinstalling Flash and all the plugins (or at least using Flashblock) and Adblock Plus+Easylist. You will achieve exactly the same results.

    I'm a web developer and I'm asking to please don't disable JavaScript. It's not a security problem per-se if you keep your browser updated and in fact makes the web *less* safe because encourages legitimate web developers to use much worse alternatives, like Flash.

    --
    There's a hidden treasure in Python 3.x: __prepare__()