Wednesday, 20 July 2016

Mozilla will finally add multi-process support to Firefox 48


Almost seven years ago, Mozilla announced that it would begin implementing a new multiprocess-capable version of its popular browser. Now, it’s finally ready to start rolling that capability out to its users, though only slowly at first. As of this writing, Firefox’s multi-process implementation (dubbed Electrolysis, aka e10s), will roll out to a select group of beta users testing Firefox 48. If the initial testers find no problems, the feature will be enabled on more and more systems, until it debuts in Firefox 48 in roughly six weeks. Here’s how Mozilla describes its own feature implementation.



Similar to how chemists can use the technique called electrolysis to split water into hydrogen and oxygen, we’re using project Electrolysis to split Firefox into a UI process and a content process. Splitting UI from content means that when a web page is devouring your computer’s processor, your tabs and buttons and menus won’t lock up too…

This is a huge change for Firefox, the largest we’ve ever shipped… As noted earlier, this is just the first phase. Next up we’ll be working to get E10S to the cohorts not eligible in Firefox 48. We want 100% of our release users to benefit from this massive improvement. After that, we’ll be working on support for multiple content processes. With that foundation in place, the next projects are sandboxing for security, and isolating extensions into their own processes.

 

 
Adding multi-processing Chrome, Internet Explorer, and Edge have all used multi-process sandboxing for tabs for years. In this model, each browser tab is independent from the other. The upside to this approach is that a single slow-running tab can’t lock up the entire system, and it allows each tab to be independently sandboxed from the others. One of the downsides is that this requires more memory on a per-tab basis, which is why Chrome has sometimes been criticized for being a RAM hog.

Multiple Firefox processes


Firefox multi-processor implementation (artist’s depiction) Unfortunately, Firefox wasn’t designed to implement each tab as its own independent process, and adding this capability required the team to rearchitect significant chunks of the browser to be compatible with this new approach. Electrolysis won’t implement multi-process support in a single leap — instead, all pages will exist in one thread, while the UI is spun off to a different thread. This should still alleviate some of the stutters and slowdowns you see from FF when the browser has many tabs open. Whether or not it completely alleviates the problem is still an open question; I regularly see Firefox’s RAM usage balloon up to 2-4GB, only to collapse back down to 1/10 that size when I open and close the browser. (Turning off all add-ons and running in Safe Mode doesn’t fix the issue.)
The long-term goal of Electrolysis is still to create a browser with per-tab isolation, but it’s not clear when Mozilla will hit that target. Development on Electrolysis stopped for several years, while the company attacked other low-hanging fruit to improve responsiveness and performance, but the need to rebuild the browser from the ground up has also delayed the rollout.
Electrolysis should be faster and more responsive once FF48 debuts, but whether it’ll help stem Mozilla’s market share decline is another question altogether.
Data from Statcounter shows that Firefox’s market share has been trending downwards, as has IE/Edge. While the decline looks modest over just the last few months, Firefox has been slowly bleeding market share for years — according to Statcounter, its June 2014 market share was 19.6%, compared with just 15.6% this April. IE and Edge have also been dropping off, despite Microsoft’s efforts to push users towards Windows 10
.


StatCounter1