Slashdot Mirror


Next-Gen JavaScript Interpreter Speeds Up WebKit

JavaScript is everywhere these days. Now WebKit, the framework behind (among others) Safari and Safari Mobile, as well as the yet-unreleased Android, is getting a new JavaScript engine called Squirrelfish, which the developers claim provides massive speedups over the previous one. The current iteration of the engine is "just the beginning," they claim; in the near future, six planned optimizations should bring even greater speed. With JavaScript surviving as a Web-page mainstay despite many early gripes, and now integral to some low-powered mobile devices, this may mean many fewer wasted seconds in the world.

7 of 193 comments (clear)

  1. squirrelfish? by the+donner+party · · Score: 5, Funny

    What's next? rabbitelephant? curvaceous coelacanth? fishfishfishrabbitfish? We desperately need an automatic "hip open source software name generator" before someone gets hurt.

  2. Re:The real question is.... by samkass · · Score: 5, Informative

    According to this link, the SquirrelFish in the latest nightly build (without the extra optimizations) can already compile *and* run the source code between 1.08x and 1.94x as fast as Tamarin when Tamarin is just running pre-compiled code. It's fast.

    --
    E pluribus unum
  3. Re:The real question is.... by Anonymous Coward · · Score: 5, Interesting

    It feels like Safari is moving so incredibly quickly. Webkit 3.1 already felt around twice as fast as webkit 3.0 in terms of javascript execution; now SquirrelFish is around one and a half times as fast again... in what's basically its first stable implementation. And they're already targetting optimisation points, and it's already caught up to Tamarin (and iirc webkit 3.1 is at least on par with firefox 2/3). Absolutely amazing.

    The iPhone is the one to really benefit from this, because it's where the pauses are currently noticeable.

    And IE really, really suffers in comparison. Microsoft has to be wincing about all this, if only for pride's sake... I'd love to see speed improvements to IE 8 beyond the what's known already, though the DOM speed improvements will help a lot for parity.

  4. Javascript grows up by Slur · · Score: 5, Informative

    "With JavaScript surviving as a Web-page mainstay despite many early gripes..." This notion has long been outmoded... well, at least for the past few years.

    Javascript is doing more than just surviving. Early implementations of Javascript were quite buggy and standards were pretty lax. Things have improved significantly since "Javascript" became ECMAScript. The name may still have "script" in it, but it's a huge misnomer. Javascript is a full-fledged language - a very powerful one with many unique properties, and very useful if you know how to apply design patterns.

    I encourage anyone involved in building websites, widgets, or enterprise applications to check out the Javascript lecture series by Douglas Crockford of Yahoo! located at http://video.yahoo.com/video/play?vid=111585 to get a real feel for the power of modern Javascript.

    And have a look at the modern AJAX frameworks like YUI and JQuery, which are being used to develop some pretty complex applications.
    --
    -- thinkyhead software and media
    1. Re:Javascript grows up by jamshid · · Score: 5, Interesting

      This was a really interesting article about the kind of optimizations javascript is getting. Btw, it still amazes me that after the GUI class library wars of the 90s, and all those Java ui frameworks in the early 2000s, "javascript over http" is state of the art in human-computer interfaces. Anyone who would have accurately predicted this future would have been labeled a madman.

      http://steve-yegge.blogspot.com/2008/05/dynamic-languages-strike-back.html

      "Why JavaScript? Well, it was Ajax. See, what happened was... Lemme tell ya how it was supposed to be. JavaScript was going away. It doesn't matter whether you were Sun or Microsoft or anybody, right? JavaScript was going away, and it was gonna get replaced with... heh. Whatever your favorite language was.

      I mean, it wasn't actually the same for everybody. It might have been C#, it might have been Java, it might have been some new language, but it was going to be a modern language. A fast language. It was gonna be a scalable language, in the sense of large-scale engineering. Building desktop apps. That's the way it was gonna be.

      The way it's really gonna be, is JavaScript is gonna become one of the smokin'-est fast languages out there. And I mean smokin' fast."

  5. Re:The real question is.... by Jay+L · · Score: 5, Insightful

    Um, no. I miss the days of hand-optimizing branches as much as the next guy, but the latest trend toward bigger, bulkier software isn't stemming from Microsoft this time. It's because computers are cheaper than developers.

    I recently had the opportunity to work with some code I hadn't touched in over a decade, and port it to a modern hardware platform (same OS). It was amazing, because I could now do the "overnight full build" in 15 minutes. Daemons that used to take 5-10 minutes to compile now took 1 to 2 seconds.

    Faster computers change everything. (Just like the availability of cheap screens, and then cheap graphics hardware, moved us from teletypes to CRTs to GUIs.) Continuous integration? Sure, we have cycles to spare. Automated testing? Ditto. Over-modularized components for quicker builds? Don't need 'em. Complex, custom circular buffers? Just log it and parse it later. Need more cache? Have some RAM.

    Could I still write code that fits in 2048 bytes and runs at 1MHz? Sure. Can I do a lot more when I don't have to worry about it? Yep. Do we gain more from standing on the shoulders of frameworks and libraries than we lose to hardware costs? Hell yeah.

  6. Still seems slow... by Jon+Abbott · · Score: 5, Interesting

    I just loaded the latest nightly of WebKit, which from what I gather is supposed to be using Squirrelfish, but it still seems to run the "Wundermap" at wunderground.com more slowly than Firefox 3.0RC1. I consider the Wundermap to be the ultimate browser test, as it has to process so much JS and images... I recently tried running it on a Mac Pro 8-core at the local Apple store, and it still loaded slowly! The Mac Pro absolutely flew through everything else I threw at it, including playing multiple HD movies at the same time, but when loading the Wundermap, it is almost as slow as my puny 2.0 GHz G5.