How many of you are using an IP here?
So who's annoyed by the message once in a while that you get about?
You need to restart, not need to continue using it.
Nobody's annoyed.
Oh, shit, you're working for nothing.
And so Alex is going to talk about that.
So please sit, remember sit in the middle.
So people that come late can sit.
Thank you very much.
Oh, one last thing for the newcomers.
We exit by the door that are downstairs.
There are stickers on the tables.
Here, here and there.
Please feel free to take them.
Hello.
Welcome to this talk.
So I'm Alex and I have been working for Amazilaf for more than 11 years now.
And I'm here to present you something we call FOX over.
There is not my name on the slide because it has been a walk.
Not just done by me, but it also involved.
Think early, jet Davies, Nikolay Zerl and other people.
So this is what he do with what he was talking about.
How many people have been annoyed by that?
On the daily basis.
It's mostly people on the Linux or on the release.
And let's explain why you see this.
So the reason is that when we create a new process in Firefox,
we have to read from this.
And whatever is on this may have changed because your package manager applied an update.
And so when we start the process, the title says that you need to view a website
and just open the tab.
Then we have the child that is going to communicate with the parent process,
although IPC.
And the first thing that we are going to do is to verify the version that we are talking about of the IPC protocol.
Because if we are not choosing the same version,
we are going to run into very weird issues that we had in the past,
that we are triggering super complicated bugs,
as well wasting our time.
So we decided to say if the version on this does not match the version in memory,
between the parent and the child, then we stop everything,
and we are no people.
Because it's much fun for you to be annoyed,
and for us to be annoyed.
That's the main motivation for the user facing value of FOX server.
So first I will try to explain to you how we go into the situation with so much processes,
and why you run into that issue so often.
Then we will explain a little bit in detail,
but not to mention what is FOX server.
And I will look at the improvements outside of this dialogue,
which should not come anymore.
Let's do a little bit of a story.
A long time ago, the web was very simple.
You had no audio, you had no video, you had computers with only one processor,
as the security was not so much of a big issue.
The attack surface was much simpler.
So the original design of a browser was a single process, doing everything.
Doing UI, rendering of the web pages, doing the disk access, everything, everything.
And there was no good reason to split that into many processes.
Because you had no CPU within our processes to take advantage of it.
Then a few years later, we introduced audio, we introduced video.
And we did that, for example, using Flash, using MPAPI, which some of you might remember.
And those were very complex pieces of software running within the process.
So adding a lot of attack surface to the process, adding a lot of stability issues.
So there was a good incentive to have a separate process for them.
Because, for example, if Flash was behaving badly, we could kill it and restart it.
We started having the world browser to crash.
So it was convenient for user and first convenient for us.
So there was a bug that we would be blamed about.
And the story continues a little bit over.
We had GMP, which introduced some video codecs.
And at some point, the web became a little bit more complicated.
We started to have to isolate stuff.
And with more complexity, we introduced even more processes.
Like GPU content, web extension.
And as of today, everything involved is a process type in Firefox.
So it means that you have around 10 process types that you can have on your computer.
If you go into about processes, you will see a lot of them.
And for example, content processes can be insulated for each type on the browser.
So each time you load the new website, you have a new process.
It's more or less that we have processes to manage access to the GPU,
to take care of the video codecs, to perform audio and video recording,
to perform network access.
And one of the main reason we have that way to put things in two different processes
is security, mostly, because we can perform sandboxing at the process level.
On Linux we perform sandboxing using a second.
So it means that we are filtering system codes.
And one very simple example is that content process does not have access to the file system.
It does do a broker request to the parent process that can verify the file system access.
So it means that we can control even not directly security.
We can for being accessing some stuff for security purposes.
We also use that for fingerprint processing focus.
And recently we also introduced a new kind of process utility process that has a unique property
to allow us to sandbox even more simply things.
Because in the past I think a new type of process was a little bit complicated.
And we wanted to be able to say to sandbox a little bit more, especially for example.
Audio recording that was in the past living within the RDD process.
So it means that we had two shares the same sandbox between video decoders and audio decoders.
And video decoders may require our other access to a specific area of, for example, your GPU to perform audio decoding.
And doing that often means that you have to open holes in the sandbox.
And sandbox you want it to be as tight as possible.
And the only way to sandbox differently is to have different kind of process.
Let's just explain a little bit how we create a process.
So for those of you who are a little bit used to that only mix, you do clone and fork.
And then you do exact and exact is a good thing because it results everything from scratch, which is also a bad thing.
Because it reloads everything from scratch.
So everything we did in one process we have to redo every time.
And we lose all the nice things that we have on fork like copium right,
which means that when you fork a process you should be able to share memory that has not been modified by the child.
And we cannot do that anymore.
So each time we create a new process it has a ghost in CPU time and in memory.
And as you so now we have a lot of processes in Firefox.
And this is why we are for example.
So how do we create a new process with box server? We ask another process.
On Chrome they already have Zigotty. On Firefox OS a long time ago we had a process called new work.
And this strategy is very simple. We start our process.
We get it as far as we can in the startup process.
And we will fork from that point later.
So this way it's faster. We don't have to redo some of the installation.
We can share more memory between processes.
The risk is that now we don't have exact.
So we may get into a state where we are sharing steps that we don't want to share.
Like for example some random generators, which is not a good thing.
Newer was one of the solutions we had on Firefox OS.
It was very complicated.
But completely started content processes.
So the ones that we used to run our web pages.
And it froze them.
And it did a lot of magic to be able to improve them and put them back into a state where it can be used as a new process.
And it was very efficient.
But it was also super fragile.
And I have been myself the victim of a nasty regression.
And I just added a test for Firefox OS.
And we had a very bad execution time regression.
And people blame me when it was in fact a regression on newer.
We spoke several.
We have decided to go with a more simple design.
We do not start a whole content process.
We just start a very minimal process.
But that is not minimal enough to share enough of data.
We do a communication of our socket to perform the call to say,
hey, I want a new process.
And we do not start a JS.
And that is already a bit of changes.
We are to deal with chain model states.
If we do not do that, we completely regressed web content performances.
And I added a bit of with PGO and PIDs.
Basically, when we learned it, alpha of July, we got back to it.
Because we have completely destroyed performances.
Because we just broke PGO.
But that is fine.
And why is it fine?
Because we have been able to relent.
And now it is enabled by default on Linux,
unlike it since end of October.
There is still some work to perform, to be able to enable that on all of the channels.
But as much as I know, there has been nobody complaining about user creation,
which is nice.
So if you are using Nikely on Linux, please have a look.
And maybe we have missed some issues.
And please report them so that we can fix it.
Because this is the wins that we have.
So on those two shots, the first one is the memory usage of content process.
You don't see the figures, but stack of points on the other side is around 15 megabytes.
That's before we are able to focus out there.
And when we are enabled it, we go to 75 megabytes.
So you can also see the times we enabled and got back out.
So 50% improvement.
And here we have a metric that we used to see as a start-up time of a process.
So we went from around 60 milliseconds to around 52 milliseconds.
So 75% improvement.
That's not bad.
And I guess that's all.
If you have question.
Yes.
So any questions?
And I guess we don't have questions.
Thank you Alexander.