Slashdot Mirror


Firefox 18 Beta Out With IonMonkey JavaScript Engine

An anonymous reader writes with a quick bite from The Next Web about the latest Firefox beta, this time featuring some under-the-hood improvements: "Mozilla on Monday announced the release of Firefox 18 beta for Windows, Mac, and Linux. You can download it now from Mozilla.org/Firefox/Beta. The biggest addition in this update is significant JavaScript improvements, courtesy of Mozilla's new JavaScript JIT compiler called IonMonkey. The company promises the performance bump should be noticeable whenever Firefox is displaying Web apps, games, and other JavaScript-heavy pages."

26 of 182 comments (clear)

  1. So far by ArchieBunker · · Score: 2

    None of these improvements feel any faster. Pages still load as quickly as they did a decade ago (provided your connection was fast). Why can't they make anything render faster?

    --
    Only the State obtains its revenue by coercion. - Murray Rothbard
    1. Re:So far by Billly+Gates · · Score: 3, Interesting

      None of these improvements feel any faster. Pages still load as quickly as they did a decade ago (provided your connection was fast). Why can't they make anything render faster?

      Have you used Firefox 3.6 recently? It sucks very badly which is why myself and Hairyfeet been promoting Chrome for 2 years. Run it on a VM and IE 9 is many multitudes a better browser. 10 years ago IE 6 broke all records in javascript performance. Run that today and slashdot and its default MSN homepage will crash within 20 seconds as the javascript interpretter can only run in 20 megs or ram and will crash.

      Old macs at my employer in the breakroom running Safari 1.x from 2006 is simply not even usable as yahoo.com takes 5 minutes to load.

    2. Re:So far by epyT-R · · Score: 4, Insightful

      javascript was never meant to do the things it's being used for now, that's why sites are so damned slow now.

    3. Re:So far by NightHwk1 · · Score: 4, Insightful

      What sites are so damned slow? It's not the Javascript in most cases, it's the asset loading. The tubes are still the bottleneck on the web.

      If anything, Javascript is speeding things up. AJAX content updates without a full page refresh are commonplace now, and there are more and more sites that are mostly client-side, using frameworks like Backbone.

    4. Re:So far by tlhIngan · · Score: 4, Informative

      What sites are so damned slow? It's not the Javascript in most cases, it's the asset loading. The tubes are still the bottleneck on the web.

      If anything, Javascript is speeding things up. AJAX content updates without a full page refresh are commonplace now, and there are more and more sites that are mostly client-side, using frameworks like Backbone.

      Well, let's see. Go to a site like Engadget and make sure your javascript allow settings are set to show the page comments. Now open 24 hour's worth of news postings in tabs. After about halfway through, your browser will start to lag with CPU pegged. It's not loading content off the Internet if your CPU is pegged. But it's just all the instances.

      Or you can replicate it with a busy thread like one of their "post a comment to enter in a draw), where it gets around 200 comments a minute. You'll find the browser noticably slows down as the javascript is constantly running.

      Repeat same with a site like Gizmodo (probably an even worse offender). I can't open more than 10 tabs at a time before the browser locks up for a few minutes at 100% CPU.

      Latest firefox and Chrome. Websites just gobble up the Javascript processing. Those sites are unusable on weaker javascript engines.

    5. Re:So far by Darinbob · · Score: 3, Insightful

      Or we just turn back to clock to the good old days where web sites were about presenting information simply with a simple markup language instead of trying to be a full application.

    6. Re:So far by DNS-and-BIND · · Score: 3, Insightful

      Because all the speed improvements were used by developers not to give the user a better experience, but to develop ever-more-complex pages. "Look, this new browser is 50% faster. Now, we can make a super-complex web page and still get the old speed!" Repeat for every speed increase.

      --
      Shutting down free speech with violence isn't fighting fascism. It IS fascism!
    7. Re:So far by Billly+Gates · · Score: 2

      FF 4 came out in March 2011. I remember the day vividly. That is 18 months old. 12 years ago we were waiting for the all so aweome IE 6 with the correct box model ohh and ahh.

      That might not seem a long time ago to many here but the way the browser wars 2.0 are heating up it is becoming the next IE 6 of FF FAST! A world of difference in just a year and a half if you benchmarked both.

    8. Re:So far by wmac1 · · Score: 4, Informative

      Engadget has heavily linked in components from other websites in the form of inline-frames , advertisement, images, tracking etc. They have also heavily used Javascripts, transparent layers etc. One would think they purposefully applied "worst practices".

      Having either DNT+ or AdBlock (with privacy filters) will stop the commenting system altogether.

    9. Re:So far by wvmarle · · Score: 4, Interesting

      Slashdot is a prime example of a site heavily using javascript.

      Ubuntu 10.04 LTS stuck to Firefox 3.6 for a long time. When loading a /. page, particularly one with many comments, it often gave me the "script is taking too long to complete" warning message. It would eventually complete, but took long. When Ubuntu finally replaced the browser with a newer Firefox, that problem was solved. It now renders reasonably fast.

      And considering I have ads disabled, it is really /. itself that's so demanding.

    10. Re:So far by ArcadeMan · · Score: 3, Insightful

      It's not really Javascript's fault, it's all the damn know-nothing Web monkeys out there.

      I'm checking the code of one website at the moment, and they're loading all that crap:
      mootools-core.js
      core.js
      caption.js
      jquery-1.6.1.min.js
      jquery.bxSlider.js
      jquery.js (yes, jquery AGAIN along with some checks to see if it's already loaded -WTF)
      script.js

      There's also the following inline javascript functions:
      - something to add caption to images on page load (calls caption.js)
      - something to track page views

      Why do they load all this crap? There's an image-changing mouse-over effect on the Facebook and Twitter icon, and a cross-fade of images on the home page. That's it.

      It's no wonder people think Javascript is crap when it's being used by people who don't even understand the kind of overload they're putting on the browsers.

    11. Re:So far by KingMotley · · Score: 2

      Not sure what you think the problem with that is actually. Yes, loading jquery a second time is bad and should be removed. It appears that caption.js relies upon mootools, and I'm not sure what core.js is.

      The REAL problem is HTML5/CSS3 committees not getting off their collective asses and finalizing the spec. Then waiting for the browsers to all actually implement it, and then finally waiting for people to upgrade to those browsers. The last part being the most important as many refuse to upgrade even to browsers that (fully) support older standards.

      This causes the need for all these so called frameworks that fill in all the missing pieces and give a standard API for web developers to use. If HTML5/CSS3 were complete, all the browsers implement them, and people upgraded to them, then the vast majority of what these frameworks do is no longer needed. Plug ins like caption.js, and jquery.bxSlider.js would just use the native HTML5/CSS3 instead. I've coded enough javascript that breaks in interesting ways in different browsers that I don't even try anymore. I load jQuery and write to that API instead, and trust that either it works across all the browsers, or it will be fixed faster (and less wasted time on my part) than if I did it myself. Those few times where I catch something, I file a bug with the jQuery team and then see if I can fix it myself or come up with a workaround.

  2. Re:With this frequency, I can't keep up! by Tarmas · · Score: 2

    With Mozilla's frequency of spitting out new and newer versions, I just can't keep up!

    No problem, just turn automatic updates on.

    --
    Signature has left the building.
  3. IonMonkey, JagerMonkey, TraceMonkey, SpiderMonkey by file_reaper · · Score: 5, Interesting

    I haven't kept track with the JIT's that have been in Firefox. I recall the days when TraceMonkey and JagerMonkey were added to boost performance. Could somebody recap or tell why Firefox is abandoning the older versions or redoing them? I'm truly curious as to what they learned, what worked and what didn't work. Are they finding new usage patterns that warrant a new JIT design? Thanks.

  4. JS Speed is the deciding factor in modern webpages by detain · · Score: 5, Insightful

    Its good to see the focus of this release being an attempt to increase javascript speed by leaps and bounds. Modern webpages often use JS that goes way beyond anything people did 10 years ago (Jquery for example) and the complexities of what people do with javascript noticably slow down most webpages considerably.

    --
    http://interserver.net/
  5. Re:JS Speed is the deciding factor in modern webpa by VortexCortex · · Score: 3, Interesting

    Its good to see the focus of this release being an attempt to increase javascript speed by leaps and bounds. Modern webpages often use JS that goes way beyond anything people did 10 years ago (Jquery for example) and the complexities of what people do with javascript noticably slow down most webpages considerably.

    When I first learned to program in BASIC, I used to think that people should try speeding up C and Assembly language -- Make EVERYTHING run faster... Then I learned C and x86 Assembly and I realized, you can't speed up assembly language -- It's a perfectly optimized language, there's nothing under the hood to tweak. You might select a better algorithm, or better use registers, but this isn't changing ASM. C can't really be hugely optimized either, it's pretty close to the metal, but there there are a few things one can do to increase performance in the space of its minimal abstractions; fewer with a mature compiler on mature hardware/platform...

    I always wondered what the deal was with JavaScript too, "Wow, it's getting faster, AGAIN?" Then I created my own languages and compilers and I learned: A sign of a horribly designed language is that the speed of its implementations can be repeatedly increased "by leaps and bounds"...

  6. Re:Still slower than v8 by Fnkmaster · · Score: 2

    But only marginally so. In most benchmarks, it looks to be roughly on par with v8 now. In some, what, 20% slower? I think that's pretty respectable - compare with the situation a year or two ago when Firefox's Javascript engine was several times slower than v8.

  7. Re:IonMonkey, JagerMonkey, TraceMonkey, SpiderMonk by Turnerj · · Score: 5, Informative

    Wikipedia goes into a bit of detail about it but in basic summary...

    TraceMonkey was the first JIT compiler for SpiderMonkey released in Firefox 3.5.

    JagerMonkey is a different design on TraceMonkey which outperforms it in certain circumstances (Some differences between TraceMonkey and JagerMonkey)

    IonMonkey is another attempt at better perfecting the idea of JagerMonkey allowing even greater optimisations under particular circumstances.

    However TraceMonkey, JagerMonkey and IonMonkey are part of SpiderMonkey as JIT compilers, not a replacement of SpiderMonkey itself.

  8. Re:IonMonkey, JagerMonkey, TraceMonkey, SpiderMonk by BZ · · Score: 3, Informative

    That's not quite true.

    TraceMonkey has in fact been removed, and JaegerMonkey may be too once the new baseline JIT being worked on now is done.

  9. Re:IonMonkey, JagerMonkey, TraceMonkey, SpiderMonk by BZ · · Score: 5, Informative

    A short summary:

    1) TraceMonkey turned out to have very uneven performance. This was partly because it type-specialized very aggressively, and partly because it didn't deal well with very branchy code due to trace-tree explosion. As a result, when it was good it was really good (for back then), but when it hit a case it didn't handle well it was awful. JaegerMonkey was added as a way to address these shortcomings by having a baseline compiler that handled most cases, reserving tracing for very hot type-specialized codepaths.

    2) As work on JaegerMonkey progressed and as Brian Hackett's type inference system was being put in place, it turned out that JaegerMonkey + type inference could give performance similar to TraceMonkey, with somewhat less complexity than supporting both compilers on top of type inference. So when TI was enabled, TraceMonkey was switched off, and later removed from the tree. But keep in mind that JaegerMonkey was designed to be a baseline JIT: run fast, compile everything, no fancy optimizations.

    3) IonMonkey exists to handle the cases TraceMonkey used to do well. It has a much slower compilation pass than JaegerMonkey, because it does more involved optimizations. So most code gets compiled with JaegerMonkey, and then particularly hot code is compiled with IonMonkey.

    This is a common design for JIT systems, actually: a faster JIT that produces slower code and a slower JIT that produces faster code for the cases where it matters.

    https://blog.mozilla.org/dmandelin/2011/04/22/mozilla-javascript-2011/ has a bit of discussion about some of this.

  10. Re:So it'll actually be respectable on Facebook? by zrbyte · · Score: 4, Funny

    aaaand I'll be abel to boot Linux faster!

  11. Re:JS Speed is the deciding factor in modern webpa by madsdyd · · Score: 4, Insightful

    I don't understand why this comment got +5. It is pretty misguided.

    The statement:

    > I realized, you can't speed up assembly language -- It's a perfectly optimized language, there's nothing under the hood to tweak

    makes some limited sense in some contexts (one could argue that the microcode supporting the assembler on the CPU is repeatedly optimized), but none in this. The IonMonkey JIT does essentially optimize the assembler code[*], by rearranging it in various ways to make it faster. E.g. it takes stuff like this (in javascript, as I have not written assembler in years):

    for ( var i = 0; i != 10 ; ++ i ) {
        var foo = "bar";
    }

    and changes it to e.g. this:

    for ( var i = 0; i != 10; ++i ) {
    }
    var foo = "bar";

    possibly then this:

    var foo = "bar";

    This is an optimization and it is performed at assembler level (Again: the above is not meant to be read as JavaScript, but assembler).

    The other statement that really sticks out is this:

    > A sign of a horribly designed language is that the speed of its implementations can be repeatedly increased "by leaps and bounds"...

    This simply highlights that the poster really do not understand the goals behind crossplatform languages, such as Java, Dalvik, JavaScript, lisp, ML, Python, Perl, and so on, or the goals for weakly typed languages.

    [*] It works on an abstract representation of the assembler code, but it might as well have been working directly on the assembler, was it not for the fact that this would require it to learn to many assembler variants.

  12. Re:So it'll actually be respectable on Facebook? by serviscope_minor · · Score: 3, Informative

    I have to support a lot of low power systems and since around FF V6 its been completely unusable, especially for watching SD video, but even opening new tabs can cause FF to slam the CPU to 100%.

    Well, yes. I have an eee 900 (which is single core). I found firefox and chromium both to be pretty pathetic at playing video. Even in HTML 5. Actually, I'm not sure how they manage to make such a meal of it. It's really terrible. They're basically no better than flash. Perhaps even worse.

    I used to use flashvideoreplacer, but that doesn't work any more. I now use a greasemonkey script which basically replaces youtube videos (perhaps others?) with MPlayer, and it can decode 720p just fine in realtime.

    Firefox can slam the CPU to 100%. Chromium is multiple threaded, so it can slam the CPU to 100% with a load average of 57 making the machine grind completely to a halt.

    Chromium feels a bit snappier in that the UI elements give visual feedback quicker, but it doesn't actually seem to get the pages up faster. I switched back to firefox after a while.

    --
    SJW n. One who posts facts.
  13. Re:JS Speed is the deciding factor in modern webpa by serviscope_minor · · Score: 2

    Then I learned C and x86 Assembly and I realized, you can't speed up assembly language -- It's a perfectly optimized language, there's nothing under the hood to tweak.

    Well, not really. You can't optimize perfectly optimized assembly any further, but that's just tautology. You can optimize even quite well written assembly further, especially on modern CPUs with various selections of functional units, variable pipelines, multiple instruction dispatch per cycle, vectorising etc.

    In fact, the days have generally passed where I can write better ASM that what gcc can output from a C/C++/Fortran program, because it has much better knowledge of the CPU internals and is generally better at doing things like register allocation etc.

    In terms of Fortran, C99 and GNU's extensions to C++, it can even be told when pointers don't alias, so one of the final benefits of assembly has vanished. With good SSE scheduling and support from within higher level languages, the other main benefit of assembler has vanished.

    It's now at the point where C++ is generally faster than assembler for all but the best of assembler programs and some very specific cases, for instance where it helps to have direct access to something like the CPU flags.

    One reason is that the optimizers have got really, really good. They can even figure out when you're stepping through a 2D array in the wrong order can re order the loops. They are also excellent at removing redundancy which means you can write simpler code (and therefore write more advanced algorithms much more easily) without worrying about redundancy killing performance.

    The optimizers are amazing and do an awful lot. This is why optimized code is more or less impossible to debug. Once it does passes of inline, partial redundancy emimination, loop unswitching, fusion, strip mining, dead code elimination, constant propagation, alias analysis, loop unrolling, modulo scheduling and register allocation, a given instruction probably doesn't correspond to any one line of code at all, so no stack trace is even possible.

    And as for assembly, things aren't so simple there. Look at the difference between the faster clocking P4 and the much faster performing Ivy Bridge i7. The result of that is essentially that the i7 has an optimizer inside it which runs at 3.3 GHz and performs many of those steps real-time before actually farming out instructions for computation. IPC is all about optimizing assembler as much as possible.

    Then I created my own languages and compilers and I learned: A sign of a horribly designed language is that the speed of its implementations can be repeatedly increased "by leaps and bounds"

    It depends on what you mean "horribly designed". Many languages are designed to be easy for some particular task rather than maximal performance. It's hard to argue that Haskell is poorly designed, but optimization is a very tricky problem and performance has certainly increased greatly as optimization techniques have become well understood.

    Even FORTRAN, which was specifically designed to be optimizable even given the non-existant state of the art at the time (optimizing compilers were essentially invented for FORTRAN) has seen significant improvements in the performance of the compilers.

    C and C++ which were designed to be close to the metal and so not need much optimizing have also got much better with improved optimizers.

    It seems that the key to a high performing language is to allow the user to tell the computer as much as possible about the program's intent, so that things can be proven and optimization can be performed.

    --
    SJW n. One who posts facts.
  14. Re:IonMonkey, JagerMonkey, TraceMonkey, SpiderMonk by BZ · · Score: 2

    The problem is that as runtimes evolve the compiled format changes. Furthermore, the end result of the compilation depends on the exact processor being used by the user, and at least in SpiderMonkey on things like the location of the Window object in memory.

    Not only that, but the final compiled version is unsafe machine code, so a browser couldn't trust a web page to provide it anyway.

    So pages wouldn't be able to provide a final compiled version no matter what. They may be able to provide bytecode of some sort, but again the bytecode format browsers use is not fixed (assuming it exists at all; V8 doesn't have a bytecode) and compilation of JS to bytecode would have to be replaced by some sort of bytecode verifier for security reasons, so there may not even be much of a performance win from the switch.

  15. Re:So it'll actually be respectable on Facebook? by dririan · · Score: 3, Interesting

    Yes, apparently they did, but it's still quite recent (and only works on Windows 7). Naturally, it took them years to come out with it after 64-bit Windows came out (yes, I'm counting XP x86_64, it was a 64-bit desktop OS). Whether or not Adobe came out with it now, they're hardly the ONLY plug-in developer. The problem of plug-ins not being ported to 64-bit browsers on Windows is hardly just Adobe's. That being said, I'm not sure why you think Flash is the only plug-in Adobe makes.

    Yes, we get it, you're a person that works on everything, and so you know what you're talking about. That's nice. Some of us have been using Fx just fine (including myself), only we don't complain about it every time it comes up on Slashdot. You're not going to convince me to stop using Slashdot because you named a list of machines you work on and say that Firefox has been awful on every single one. If Fx stops working well on my machines, then I'll switch, but I'm not going to switch just because someone says Fx doesn't work for them.

    If you're talking about HTML5 video then fine, but if you're talking about Flash, why in the hell are you blaming the browser for that? Naturally, on the three computers I regularly use, I have exactly zero of the problems you mention, with both HTML5 and Flash videos. Anecdotes are completely pointless, because everyone can have different experiences. Yours aren't special because you can list a lot of computers.