The 16th version of the Firefox browser, which is scheduled for release on October 9th, contains a major update to the JavaScript engine. The garbage collector will switch from the “stop-the-world” strategy, when scripts are completely frozen for the time of cleaning, to an incremental strategy, when garbage collection occurs in several stages. Although the work of the garbage collector will generally take a little more time, browser responsiveness will significantly improve, as the interface elements, animation and games will no longer hang for a few hundred milliseconds at the time of cleaning.
You can see how the new garbage collector works and experiment with its parameters by installing the beta version of Firefox (
instructions for Ubuntu ). On the
about:config
page, the settings are in the
javascript.options.mem.gc_*
branch. You can see the result of your actions on this
demo page , which tries to update the schedule at 60 frames per second. The logarithmic scale in milliseconds shows the actual delay time between two frames. With incremental garbage collection disabled (
javascript.options.mem.gc_incremental
set to
false
), noticeable delays of 300 to 500 milliseconds periodically occur. If incremental build is enabled, delays are rarely above 50 to 80 milliseconds, which is almost imperceptible. In addition, you can monitor the state of memory and garbage collection with the addition of
MemChaser .
Work on the incremental garbage collection began more than a year ago and is now very active. In versions 17 and 18, further improvement in the characteristics of the garbage collector is expected. By the way, the responsiveness of the Firefox browser is dedicated to a
separate section on the MozillaWiki website, where all the information regarding the perceived speed, delays and hangs of Firefox is put together.
The source is
blogs.mozilla.org/javascript .
')