Getting snappy – performance optimizations in Firefox 13

Back in the fall of 2011, we took a targeted look at Firefox responsiveness issues. We identified a number of short term projects that together could achieve significant responsiveness improvements in day-to-day Firefox usage. Project Snappy kicked off at the end of the year with the goal of improving Firefox responsiveness.

Although Snappy first contributed fixes to Firefox 11, Snappy’s most noticeable contributions to date are landing with Firefox 13. Currently in beta, this release includes a number of responsiveness related fixes, most notably tabs-on-demand, cycle collector improvements, and start-up optimization.

Tabs -on-Demand

Tabs-on-demand is a feature that reduces start-up time for Firefox windows with many tabs. In Firefox 12, all tabs are loaded on start-up. For windows with many tabs this may cause a delay before you can interact with Firefox as each tab must load its content. In Firefox 13, only the active tab will load. Loading of background tabs is deferred until a tab is selected. This results in Firefox starting faster as tabs-on-demand reduces processing requirements, network usage, and memory consumption.

Cycle Collector

As you interact with the browser and Web content, memory is allocated as needed. The Firefox cycle collector works to automatically free some of this memory when it is no longer needed. This action reduces Firefox’s memory usage. In Firefox 13, the cycle collector is more efficient, spending less time examining memory that is still in use, which results in less pauses as you use Firefox.

Start-up

Firefox start-up time is visible to all users. Our investigation into start-up has identified a number of unoptimized routines in the code that executes before what we call “first paint”. “First paint” signifies when the Firefox user interface is first visible on your screen. In Firefox 13 we have optimized file calls, audio sessions, drag and drop, and overall IO, just to name a few. We are continuing to profile the Firefox start-up sequence to identify further optimizations that can be made in future releases.

There are numerous other Snappy fixes in Firefox 13 including significant improvements to IO contention, font enumeration, and livemark overhead. All of these fixes contribute to a more responsive experience. We are already working on further responsiveness fixes for future Firefox releases. You can expect to see Snappy improvements in upcoming releases in areas such as memory usage, shutdown time, network cache and connections, menus, and graphics.

View full post on Mozilla Hacks – the Web developer blog

8 thoughts on “Getting snappy – performance optimizations in Firefox 13

  1. eddie

    This week my laptop was unusable, and I launched the Task Manager and Firefox was using 4 GB of RAM. I had enough. I have been angry for a ling time with Firefox turning my i7 into a 80486. I have now removed Firefox from all my computers.

    With the same workload, Chrome takes so much ram as Firefox, but Chrome shares the load among processes, and as result the computer is responsive, it does not behave like an 80486 and it does not turns on the heavy churning of my swap.

    Having just one process and just a couple of processes.does not scale, even if you lazily load tabs, make your garbage collector smarter a la JVM, move to jemalloc or completely rethink spidermonkey/tracemonkey. I’m not going back to Firefox because I don’t want swapping back.

    Now, Mozilla, your move.

  2. Erunno

    But Alex is right. Mozilla took their sweet time until they started seriously and methodically addressing problems like memory usage (MemShrink) and interface responsiveness (Snappy). The former project started in mid 2011 and the later one at the end of 2011 and work on them will probably continue well into 2013 (plus the time until they reach the stable channel). That’s an awful lot of time considering that Chrome first appeared in September 2008 and set the bar for perceived and actual performance for many use cases (especially those concerning for regular users). Imagine Snappy and MemShrink had been both kicked off in 2009, then Mozilla might not have bled as much market share and mind share.

  3. Todd

    Lately I have found myself using Safari more than Firefox. I want to use Firefox but I found that the Mac version has not gotten as much love as the Windows one.

    I’d love an updated interface or some Lion tweaks like back and forth gestures, true full screen, and iCloud bookmark syncing! 🙂

  4. taylerz

    I’d like to continue on Hogart’s comment. Ignore Rami too. Not paying attention. Firefox has gotten a lot faster in the past year, not just now. I’ve given Chrome two chances, the most recent one a week long and still found myself coming back to .. Firefox!

  5. Mike B

    Just a quick update, it was start-up tabs that I had not accessed; tabs opened in the background fully loaded before I switched to them.

  6. kwierso

    App tabs are considered things you always want loaded, so they’re always resumed on startup.

    There IS a hidden preference in about:config to stop this. Don’t have the preference name handy, but you should be able to find it by filtering on “tab”.

Leave a Reply