Announcement

Collapse
No announcement yet.

Firefox Enables Generational GC To Compete With Chrome

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    I've heard that one of the "secrets" of the Google V8 engine speed is the typing of the JS vars, from double to the type the jit guesses when a variable take some value. That's because normally a program won't use an already defined variable as another type of variable. Do you know if Firefox uses a similar behavior in its JS compiler?

    Comment


    • #12
      Originally posted by kertoxol View Post
      I've heard that one of the "secrets" of the Google V8 engine speed is the typing of the JS vars, from double to the type the jit guesses when a variable take some value. That's because normally a program won't use an already defined variable as another type of variable. Do you know if Firefox uses a similar behavior in its JS compiler?
      Yes, they've had that for years: https://wiki.mozilla.org/TypeInference

      Comment


      • #13
        wow, this is huge. It's the culmination of years of work, and I'm happy to see it finally enabled by default. Hopefully it will stay this way, and reach stable with Firefox 31.

        For anyone curious, this is (was) the second most important bug on the memshrink bug list: https://blog.mozilla.org/nnethercote...-2nd-birthday/
        And for anyone wondering why this is important (from https://blog.mozilla.org/nnethercote...nsumption-2/):
        • Performance improves for three reasons. First, paging is reduced because of the generational behaviour: much of the JS engine activity occurs in the nursery, which is small; in other words, the memory activity is concentrated within a smaller part of the working set. Second, paging is further reduced because of the compaction: this reduces fragmentation within pages in the tenured heap, reducing the total working set size. Third, the tenured heap grows more slowly because of the generational behaviour: many objects are collected earlier (in the nursery) than they would be with a non-generational collector, which means that structure traversals done by the garbage collector (during full-heap collections) and cycle collector are faster.
        • Virtual memory consumption drops in two ways. First, the compaction minimizes waste due to fragmentation. Second, the heap grows more slowly.
        • Physical memory consumption drops for the same two reasons.
        • Private bytes also drops for the same two reasons.
        By memory, now the next big thing should be e10s

        Comment


        • #14
          Originally posted by kertoxol View Post
          I've heard that one of the "secrets" of the Google V8 engine speed is the typing of the JS vars, from double to the type the jit guesses when a variable take some value. That's because normally a program won't use an already defined variable as another type of variable. Do you know if Firefox uses a similar behavior in its JS compiler?
          Firefox has had this behaviour for a long time now in different incarnations: TraceMonkey from Firefox 3, JaegerMonkey and more recently IonMonkey.

          JS types are not explicitly typed (double or otherwise). Therefore, it can be a string, integer, double, etc. When the code is first run, it is interpreted (the JavaScript engine performs the instruction specified). Part of this process in modern engines is to record information on what the types are.

          Knowing the type information, the JS engine can use that to say e.g. "this variable is an integer". Therefore, it can convert the code to assembly instructions for maximum performance (with guards if the variable type changes). This is the process of JIT compiling the code. Other languages like Java and C# have static types so can more predictably JIT compile code and do so up-front.

          Comment


          • #15
            Firefox [Iceseasel on Debian specifically] 28 consitently hangs and throttles the CPU [even with an FX-8350 and the app not spreading processes across all available cores] over 108% due to heavy javascripted sites which have auto-updates a lot.

            For instance, Have the Yahoo Sports with March madness in one tab, have two Huffingtonpost Tabs open, with the top level of either major subsection [Root level reloads constantly, Politics, Media, Tech, etc., also reload updates routinely every 30 seconds] and you've got an app who comes to a completely frozen experience.

            Fix that and I'll be impressed.

            Comment


            • #16
              Originally posted by Marc Driftmeyer View Post
              Firefox [Iceseasel on Debian specifically] 28 consitently hangs and throttles the CPU [even with an FX-8350 and the app not spreading processes across all available cores] over 108% due to heavy javascripted sites which have auto-updates a lot.

              For instance, Have the Yahoo Sports with March madness in one tab, have two Huffingtonpost Tabs open, with the top level of either major subsection [Root level reloads constantly, Politics, Media, Tech, etc., also reload updates routinely every 30 seconds] and you've got an app who comes to a completely frozen experience.

              Fix that and I'll be impressed.
              For what is worth, I don't have any problems with that, with both Firefox Stable and Nightly: http://a.pomf.se/bqsgcn.png
              I get the occasional spike when one of those pages refresh, but both browsers don't froze at all.

              (For anyone wondering, Stable has a much higher memory usage because I have a lot of tabs open in a different window).

              Have you reported the problem over bugzilla?

              Comment


              • #17
                Obvious troll?

                Comment


                • #18
                  And here I am with 14 tabs opened in chromium using 2gb of memory.

                  Comment


                  • #19
                    3G6A5W338E - Horton/BO$$ is that you? I was wondering how many days would go by without your vitriol posts.

                    Oh well, another name to add to the ignore list.

                    Comment


                    • #20
                      Are there any actual benchmarks at this point to show the difference in memory consumption for this new generational GC? This might actually help an issue I've been having these past few years where long running sessions of firefox utilize an excessive amount of memory (i've had it run well past 4GB (so glad my desktop has 16GB of ram...)) and the browser slows down to an utter crawl regardless of the number of tabs open.

                      tbh I blame the modern web and it's attitude of using excessive amounts of javascript and trying to replace desktop applications (which is just stupid) more than anything else because back in the firefox 2.x-3.x days this really wasn't a problem, sure firefox was still a leaky pig but I'm running into so many more compatibility, memory hogging, and browser slowdown issues (as far as I recall there were no browser slowdown issues) than back in the day or even just 4-5 years ago.

                      Comment

                      Working...
                      X