
Multi-process Firefox brings 400-700% improvement in responsiveness - bpierre
https://techcrunch.com/2016/09/02/multi-process-firefox-brings-400-700-improvement-in-responsiveness/
======
rsp1984
_“We can learn from the competition,” said Dotzler. “The way they implemented
multi-process is RAM-intensive, it can get out of hand. We are learning from
them and building an architecture that doesn’t eat all your RAM.”_

That's the money quote here. I've been waiting for this for a long time
actually. Every browser I've tried except Firefox just basically eats all my
RAM and other app performance (e.g. compiling stuff) goes down the toilet.

Then on the other hand FF has not been so snappy and responsive traditionally.
So responsive + soft on RAM is the combination I've really been waiting for.
Let's hope they can deliver.

~~~
toxican
A few years ago if you'd told me FF would be the RAM-sensitive browser, I'd
have laughed you off the internet.

~~~
AdmiralAsshat
And they're still at it, too:
[https://areweslimyet.com/](https://areweslimyet.com/)

~~~
azinman2
Maybe I'm misreading things but it looks like it's been constantly getting
worse since 2012?

~~~
wongarsu
They're getting worse at a linear pace, while hardware improves exponentially.
Effectively that's a pretty good improvement each year.

~~~
1ris
Hardware does not get exponetially better. Maybe it did in 90ties and 00ers.
Right now hardwardware gets slimmer, less power consuming and cheaper. But not
better. My 12 year old (then mid-end gaming pc) is pretty much exactly as fast
as my current, 2(?) year old office machine. (x264 and other mulit-threaed cpu
benchbmarks) But it costs a fraction and uses next to no energy.

/edit: Yes this is wrong. I made a mistake. My "gaming" desktop is "only" 8
years old. It has a 4 core AMD processor. It's on par with current atoms.

~~~
dTal
Love the redundancy of "90ties", but what's the etymology of "00ers"?

~~~
rplst8
Augts?

~~~
dTal
But then, following the pattern it'd be 00ts or 00ghts...

~~~
wongarsu
two-thousanders? Not sure if anybody actually says that

------
nl
I switched to Firefox from Chrome about 12 months ago. It isn't as good as
Chrome, but I was trying to reduce my Google dependencies.

It has been mostly fine (except for an annoying OS-X multi-screen bug where it
screws up the sizing).

I was really looking forward to this feature to help close the gap on Chrome
performance.

Until August (I think Firefox 48.x), when it became unusable on any site
with... something. I'm not entirely sure what triggers it- I don't think it is
just video alone. Something make the entire browser lock up entirely for
minutes, and sometimes it even runs out of memory and I have to kill it via
the OS.

No add-ins (except for Firebug).

Frustratingly, I can't replicate it well enough to be a useful bug report.

I'm _this_ close to switching back. Muscle memory and shortcuts to Firefox is
the only thing stopping me.

So.. this will be great, but please make it a workable browser.

~~~
wjoe
I've found Firefox performance to be absolutely awful at work on OS X. I have
no issues at all with it at home on Linux, and didn't have any issues in my
previous job on OS X either. I'm not sure if it's OS X specific, a change in
recent versions, this laptop being underpowered, or the nature of the work I
do (a lot of video stuff), but anything JS heavy severely slows down or locks
up the browser. And if anything, it's gotten worse over the last few months.

I have to use Chrome for anything video related or JS heavy
(monitoring/graphing stuff for the most part), but I'd hate to switch to it
for everything. There are too many addons that I rely on in Firefox, on top of
my general dislike for Chrome's minimalist UI and standard Google privacy
concerns.

I've tried turning on the config option for electrolysis, but it breaks some
addons, so that's still a no go for me for now.

~~~
mrweasel
For a while now I've suspected that memory management on OS X is actually
terrible. I have no really proof, because I just run everything memory
intensive on Linux. At work I have a few Python script that eats a few
gigabytes of memory, it reads in data, and basically just loops over it,
selects the stuff it needs an generate a few XML file (10 to 20MB worth of
XML).

All this takes maybe five minutes on Linux, on Mac OS X it will freeze the OS
for long periods of time and take 40 minutes to run. In terms of hardware, the
Linux box has less RAM, CPU and slower discs.

Regarding the Javascript stuff: Part of it may be that Chrome is the new
Internet Explorer. People develop on and test for Chrome (because everyone
uses Chrome, right?). Chrome does have the better Javascript engine, still, I
believe that much of the slow Javascript on Firefox (an other browsers) could
be avoided if people bothered testing a little more.

~~~
fbender

        Chrome does have the better Javascript engine, still, I believe that much of the slow Javascript on Firefox (an other browsers) could be avoided if people bothered testing a little more.
    

All major engines are pretty much comparable speed-wise. The biggest
difference is probably in memory management (of the HTML & JS engines), which
may favor some forms of site/lib structure and architecture over others –
that's IMHO where the majority of slowness comes from (for any browser).

------
uuoc
This should come as no surprise. It has always been an epic architectural
mistake to use the same single non-reentrant Javascript engine to both render
the UI and run JS for webpages in Firefox. This change will finally undo that
huge mistake made so very long ago.

~~~
addicted
JavaScript was little more than a toy scripting language used to animate stuff
and change layouts when html/Css wouldn't fit for the greatest part of
firefox's early existence. At the time it was probably the appropriate
decision.

Now, it's a huge burden on Firefox and it's good to finally see progress on
this front.

~~~
eatbitseveryday
Since Javascript is just a language that happens to execute client-side within
the browser, why can we not use an existing language syntax (or an existing
language entirely) for this purpose? For example, Go, Python, Rust, or perhaps
Perl? It feels like a broken shell scripting language that really should have
been replaced.

~~~
uuoc
You can, but you should not run the UI script code _on_ the same non-reentrant
JS engine that executes scripts delivered from the internet at large.

By doing so (running both the UI code _and_ scripts from the internet on the
same non-reentrant JS engine) means that only one gets to run at a time
(either UI code or JS from the internet). That's why FF's responsiveness sucks
at times, any long running JS script from the internet also prevents the UI
code from running.

The JS engine should either have been reentrant (so UI code could run even
though some random internet script was still running), or there should have
been two independent JS interpreters loaded, one used for the UI code only and
a second for all the JS from the internet.

------
gnicholas
Instructions for enabling this feature (via about:config) are provided in the
author's prior article on the topic:
[https://techcrunch.com/2016/06/10/mozillas-multi-process-
arc...](https://techcrunch.com/2016/06/10/mozillas-multi-process-architecture-
project-cleared-for-takeoff/)

~~~
mintplant
Please be aware that if you force-enable e10s while using incompatible addons,
you'll end up with a very slow browsing experience.
[http://arewee10syet.com/](http://arewee10syet.com/) has a compatibility list
for some of the most popular addons.

~~~
diggan
Seems like e10s gets disabled if there is a incompatible addon activated.

Not sure I would trust that list, the only two addons I run, is Tree Style Tab
and Greasemonkey, both listed as compatible on the website, but going to
about:support shows:

> Multiprocess Windows 0/1 (Disabled by add-ons)

~~~
dblohm7
Addons are not supported by default in e10s mode on the release channel yet.

------
sambe
Every odd browser performance topic is dominated by people claiming Firefox
has been faster and more scalable than Chrome for years. Every even one is
dominated by people claiming the opposite.

This thread seems to be the latter, my experience is the former. If you see
bad performance/memory usage with a small number of tabs, are you sure that
it's not due to bad plugins?

I think about:memory and about:performance could be helpful. I seem to recall
they used to have some reporting on known problem plugins (perhaps as part of
[https://www.mozilla.org/en-GB/plugincheck/](https://www.mozilla.org/en-
GB/plugincheck/)).

------
danblick
Does anybody know more about how Mozilla manages experiments? I'd always
assumed that all users downloaded an identical binary and got the same
behavior. How do they assign 10% of their users to an experimental group?

Is it possible that two users will see different functionality when they are
both using the same OS and release, say Firefox from the latest version of
Ubuntu?

~~~
TheCoreh
As with most native A/B tests, the binary probably ships with code for both
functionalities. When the browser launches for the first time they generate a
random number, and if it's below a certain threshold you get variant A, above
you get variant B. The information gets persisted on disk so it remains
unchanged across sessions.

~~~
theandrewbailey
It seems that there is some communication back to Mozilla, since they claim
that they can increase or decrease the number of users in each group over a
week; that seems unlikely to come in the form of a new binary.

~~~
gsnedders
Non-stable channels get frequent builds, so it's not implausible it's a new
binary.

------
drzaiusapelord
Its incredible multi-process took this long. Just goes to show you that your
architecture decisions last a long time and are often difficult to change.
Chrome had this from day one and never had a big and old codebase to worry
about. Yet it took Firefox many years to get multi-process going and my
understanding is that its much more limited and simpler than what Chrome or
Edge do.

I'm also a little surprised there hasn't been an attempt to launch a
completely new Firefox from the ground up. Regardless of what they're doing
right now, its still a legacy code monster and much more laggy than the
competition. Maybe this is Servo's ultimate purpose, but every Firefox advance
is welcomed but always feels like another layer of lipstick on this pig.

Disclaimer: I use Firefox as my main 'non-work' browser several hours a day.
Its good, but its very obvious when I'm not in Chrome from a
performance/stability perspective.

~~~
kalleboo
> I'm also a little surprised there hasn't been an attempt to launch a
> completely new Firefox from the ground up.

It's interesting how the history goes.

We had Netscape 4, and it was crap (remember when resizing a window reloaded
the whole page?)

So they was a ground-up rewrite of the rendering engine, resulting in Gecko,
which was put in Mozilla.

Gecko was great but Mozilla was a bloaty amalgamation of features, so this was
created a pared-down Gecko version called...

~Phoenix~ ~Firebird~ Firefox, which had the great rendering engine and a lean,
native-like UI.

Then there was KHTML/KJS which was built for KDE, which had a lean
architecture but didn't have the investment to get the compatibility 100%
there...

Which Apple then poured into the project in their fork to WebKit, which paid
off in spades on the resource-limited iPhone a couple years later.

But Safari was only on the Mac (aside from their "Cocoa on Windows" version
and a few open source ports), which Google took as a reason to create...

Google Chrome, where the biggest innovation was rendering each page in its own
process (since Safari could freeze up due to one page going in an infinite
loop in JavaScript).

So will someone out-Firefox Firefox and do what Chrome was to Safari for
multi-processing? Take the rendering engine and put a new chrome on top of it?

~~~
flukus
A few additions:

KHTML was originally forked from QHtml (part of Qt) I believe (or they shared
the same origin?).

Webkit later became a Qt component, the circle of life.

I would argue chromes biggest innovation was the UI, putting the address bar
as part of the tab where it belongs (cue holy war) and better tabbing in
general.

Mozilla was also the first to integrate the search and address fields, which
they unfortunately stripped out of firefox (and many people think chrome
introduced it).

~~~
bwat48
> Mozilla was also the first to integrate the search and address fields, which
> they unfortunately stripped out of firefox (and many people think chrome
> introduced it).

Do you know when this was introduced/removed? I'm curious as to what this
implementation was as I don't recall when this happened.

~~~
flukus
It was in all versions of the Mozilla suite:
[https://en.m.wikipedia.org/wiki/Mozilla_Application_Suite](https://en.m.wikipedia.org/wiki/Mozilla_Application_Suite)
. It was never a feature of Firefox.

------
Animats
At last, you'll be able to view other pages while Facebook's Javascript is in
an infinite loop.

With thousands of MIPS and a gigabyte of memory on the job, it had better be
responsive. It's pathetic how much compute power it takes to run a browser.
Even when the pages aren't doing anything interesting. It's not like they're
running a 3D game or something.

------
corford
I've got 732 tabs open at the moment and performance is still fine. The upper
limit for my machine seems to be about 745 ish - much beyond that and FF runs
out of video memory or something (new tabs render sites half black).

~~~
ActsJuvenile
You need to get a better handle on your life.

~~~
corford
Haha yeah :) TBH I have no idea what half of them are any more. I've just
never gotten around to pruning them since FF works well enough and load up
time isn't too bad (< 12 secs).

------
faragon
Why? Except because of memory allocation serialization impact, there is no
reason for a multithreaded process being slower than multiprocess. And if
that's the cause, it could be solved using multiple heaps.

~~~
scott_s
My guess is that the multithreaded-only design wasn't as good at exploiting
the inherent per-tab parallelism. The original architecture probably had some
synchronization points (perhaps related to the common GUI code) that did not
allow processing each tab truly independently. Regarding memory allocation,
yes, in theory one should be able to try to avoid sharing data across threads,
which should eliminate serialization on memory allocation and deallocation.
But I can easily imagine that in practice, in a codebase that was not
explicitly designed to process each tab in parallel, you'll still end up
sometimes sharing data across threads.

I imagine they could have instead changed the architecture to be multithreaded
in such a way to avoid my imagined sequential bottlenecks, but performance is
not the only goal in a multprocess architecture. Sandboxing is another design
goal, and that cannot be fully achieved with a multithreaded design.

This is all speculation on my part, so if anyone who actually works on the
Firefox codebase could correct me, that would be very welcomed.

------
Lagged2Death
I'm surprised by the responsiveness claims because my ancient Windows PC runs
FF superbly. I think Win10+FF is already more responsive now than it has ever
been.

I am also using Ghostery, however, with virtually everything blocked. It
wasn't my intent to block ads, but that's mostly how it works out.

~~~
jayflux
It depends on operating system. For instance on OSX Yosemite Firefox is
sluggish, yet on Windows 10 it's fast. People should really mention what
operating system they're running when they say "x is slow"

------
Zekio
The speed is great as long as youtube doesn't autoplay a new video which
freezes the whole browser for me until it is done loading.

~~~
akerro
Whole browser freezez for me on any amazon page. Just when it starts rendering
it freezes everything inside Firefox window for a few seconds. It's so
annoying that I'm considering dropping Firefox after over a decade for Opera
or Brave browser.

~~~
nl
I wonder if this is the same issue as I'm seeing:
[https://news.ycombinator.com/item?id=12437130](https://news.ycombinator.com/item?id=12437130)

Amazon works for me though. Hmmm.

~~~
akerro
Very similar issue! My gf walked into it recently on ArchLinux, she had the
same problem, for her e10 was enabled by default. When she visisted pons.com
the whole browser was frozen for at least 10seconds, and if it didn't unfreeze
itself after that time, it was just consuming memory and freezing whole OS
until Linux killed Firefox process. My issue was solved by disabling e10s, for
her it didn't help so she switched to Opera already.

~~~
gnud
I wouldn't switch to Opera though. Use vivaldi instead.

------
rl3
This will probably have significant implications for web worker behavior.

If memory serves, workers are unable to directly communicate with each other
in Firefox when the UI thread is blocked, because message handling runs on the
same process as the UI thread. Chrome doesn't have that limitation since it's
already a multi-process architecture.

------
nchelluri
Ah, so because I use addons I might not be seeing these benefits for some
time? Good to know.

Chrome is right now way faster for me, but I prefer using FF so I am in the
Mozilla camp right now. Eager to see this rolled out. Early versions of e10s
were very fragile and not so usable for me, so I switched it off.

~~~
semicolon_storm
I use quite a few add-ons and my e10 was disabled because of them. I force
enabled e10 using Mozilla's guide
[https://wiki.mozilla.org/Electrolysis#Force_Enable](https://wiki.mozilla.org/Electrolysis#Force_Enable)
and didn't notice anything breaking (yet).

~~~
Sylos
It's usually less so things breaking and rather just being slow. For example,
if you use NoScript, it often takes really long to load up a page, because
that's when NoScript becomes active, and because NoScript isn't yet properly
e10s-compatible, it just forces Firefox to do things in a single-process way.
But that actually makes things slower than when Firefox is running without
e10s.

about:performance is a rather good indicator, if an add-on is causing slow-
downs.

------
wcummings
I've been running Firefox Developer Edition (which has multiprocess) for a few
weeks now, it's noticeably faster for most sites.

------
Double_Cast
I use both FF and Chrome. Chrome is more heavy-duty, so I use it for Dedicated
Browsing. I've set it such that when something calls me away and I close
Chrome, the tabs will reopen so I can continue where I left off. But sometimes
I'll be doing something in another program and need to look up something
quickly. In such cases, I don't wanna wait while Chrome reopens 11 tabs so
I'll use FF instead. My FF-tabs aren't saved between sessions, so I only see a
single fresh tab when I open it.

------
eberkund
You can install v51 nightlies from here:
[https://nightly.mozilla.org/](https://nightly.mozilla.org/)

------
matt_wulfeck
I don't know. "Eating up all my ram" seems perfectly acceptable to me at first
glance. I purchase ram and use it in my computer for expressly this purpose:
to improve the responsiveness and snappiness of programs.

Where do you draw the line at what's acceptable use of ram and what's not? I
have 32G on my desktop, is it unacceptable that chrome is using 8G?

~~~
scott_karana
I think it's "inefficient use of RAM" that they're talking about.

If Firefox should conceivably run in 8GB, but ends up trying to use 33GB (in
your case), that would obviously be bad.

Mozilla just targets efficiencies that include people with much, much less RAM
than you for their baseline.

------
malnourish
Is there a list of commonly used extensions that are (in)compatible?

~~~
wjoe
[http://arewee10syet.com/](http://arewee10syet.com/) has a list of addons and
their compatibility.

I tried turning on the about:config option and the URL bar broke, so obviously
something I have is incompatible - I suspect it's Classic Theme Restorer,
although that site does list it as compatible.

------
zobzu
Ive been testing Firefox e10s as in multiprocess Firefox for months now (in
Nightly, and even before that).

At some point it became very usable and it still is today. HOWEVER while the
interface is, yes, much more responsive, it is also NOTICEABLY slower.

I ended up reverting recently and I'm using single process Firefox right now.
Its fast even thus from time to time the UI may block if there's heavy stuff
going on.

Whatever makes e10s slow they gotta fix it... I suspect there's a lot of
synchronization code.

------
Zpalmtree
I hope this works out well, I often see my firefox freeze due to heavy
extensions, and would much prefer if it just froze one tab. For me, higher ram
usage wouldn't bother me if it meant no freezing, but I imagine it does matter
to most of the audience, and it's too much effort to develop two feature sets.

------
Hydraulix989
Is this different than multithreaded? What are the benefits? Is it really just
about isolation/sandboxing?

Why so much RAM? I thought the OS could share pages across processes...

------
AstralStorm
How much extra memory is now used by it? All this improvement is meaningless
if it hits swap on a typical machine.

~~~
asadotzler
We saw about 20% overhead going from one process to two.

------
zyngaro
On which OS? On OSX I almost gave up on ff because it frequently freezes for
no apparent reason.

------
spynxic
Wonder if Graal.JS could offer any improvements to the browser

------
dschiptsov
So, finally, some emerging consensus among packers that pthreads is a brain-
dead concept, and thousands of its advocates are just narcissistic idiots,
loving to hear their voices?

------
shmerl
A pity it's now practically useless, since many add-ons need modification to
keep electrolysis enabled. In a year or so things will be better I hope.

~~~
the8472
Only if addon authors fix them. Afaik mozilla devs aren't planning on adding
additional compatibility shims.

~~~
mintplant
There's currently a compatibility shim in place, however using it can lead to
poor performance.

~~~
the8472
there are multiple shims, i'm saying they're not planning on adding new ones.

------
Kenji
Does that mean my website will now fit on a 700% narrower screen?

------
midnitewarrior
Why is there still a browser capable of having its performance improve by
400-700%? This browser is a decade old. It is clearly the CPU and RAM hog
everyone has said its been.

~~~
Sylos
Responsiveness is not the same as performance. Responsiveness is how quickly
it responds to user-input. So, for example, if you click on the Back-Button,
then it highlights the Back-button to let you know that you have indeed
successfully clicked the Back-button and that it is working on going back a
page. How quickly it highlights that button after you've clicked it, that's
how responsive it is in that aspect. Actually going back a page, i.e. loading
the page from cache and rendering it, that's then again a performance-metric.

But you are also quite clearly underestimating how terrible modern browsers
are. Mozilla is also currently working on a research browser called "Servo",
which has been written completely from scratch and employs a more modern
architecture, and that isn't too far away from 400-700% performance increase
over other browsers in certain aspects.

