e10s support question

Discussions about the development and maturation of the platform code (UXP).
Warning: may contain highly-technical topics.

Moderators: trava90, athenian200

User avatar
Basilisk-Dev
Astronaut
Astronaut
Posts: 675
Joined: 2022-03-23, 16:41
Location: Chamber of Secrets

Re: e10s support question

Post by Basilisk-Dev » 2026-04-02, 11:47

jobbautista9 wrote:
2026-04-02, 02:31
I think it's more GlobalHelperThreadState::maxParseThreads, specifically the return below a comment block (which seems to be the warning that Basilisk-Dev mentioned). maxUnpausedIonCompilationThreads is related to Ion which is part of JIT.
That is it. I had the line number there when I pasted my link but I guess phpBB didn't like that.
UCyborg wrote:
2026-04-01, 20:51
Is there a build flag for JITless build you put in .mozconfig?
No, I'm currently using a LoongArch system for my desktop and an Apple Silicon Mac for my laptop. Neither of those two CPU architectures has JIT support so the browser always runs without a JIT.
Basilisk Project Owner

viewtopic.php?f=61&p=230756

User avatar
UCyborg
Board Warrior
Board Warrior
Posts: 1026
Joined: 2019-01-10, 09:37
Location: Slovenia

Re: e10s support question

Post by UCyborg » 2026-04-02, 17:51

OK, so don't need to turn off JIT (x64 Windows machine), just WASM, which I don't need often. Looks good so far, just didn't have much time to really evaluate. I'd almost say it's quite noticeable (I made it return cpuCount), but I'm not sure if memory recalls slower responsiveness in this one particular client-rendered web app at work from the browser running for a while and getting slower with runtime or was it like this from fresh start.
Off-topic:
Oooooh, I noticed Jenkins is quite a bit more colorful with this development version of Pale Moon (https://forum.palemoon.org/viewtopic.php?f=70&t=32709). Sweet!
The Merovingian wrote:Choice is an illusion, created between those with power, and those without.

User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1227
Joined: 2020-11-03, 06:47
Location: Philippines

Re: e10s support question

Post by jobbautista9 » 2026-04-03, 03:51

Perhaps we can make a pref for what number GlobalHelperThreadState::maxParseThreads returns (with the default -1 being cpuCount)? Maybe guard against the pref for enabling WebAssembly too.
Image

Tired of creating stuff!

Avatar artwork by Shinki669: https://www.pixiv.net/artworks/113645617

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
Moonchild
Project founder
Project founder
Posts: 39510
Joined: 2011-08-28, 17:27
Location: Sweden

Re: e10s support question

Post by Moonchild » 2026-04-03, 07:07

As an aside, to demonstrate the issues with e10s, current release cycle Firefox security bugs that I just went through had 45 of the bugs I looked at directly related to e10s. In just this month.
That's not counting issues that are less obviously prima facie caused by the e10s architecture of Firefox. Keep in mind how long ago this was introduced in Firefox, and we're still constantly having security issues in it every single month. It was supposed to be a "more secure" way of handling web content, remember? Because web content would be limited to its own less-trusted processes. Turns out it's suffering from exactly what I said, in that the messaging protocol itself is vulnerable to attack in ways a single-process browser would never have exposure to.
"Praise from a narcissistic person is always a poison dart. They don't share the stage, so discernment matters." - Dr. Ramani
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
ownedbywuigi
Lunatic
Lunatic
Posts: 291
Joined: 2026-03-09, 21:48
Location: United Kingdom

Re: e10s support question

Post by ownedbywuigi » 2026-04-03, 07:48

Moonchild wrote:
2026-04-03, 07:07
current release cycle Firefox security bugs that I just went through had 45 of the bugs I looked at directly related to e10s. In just this month.
Does Chromium or other engine’s multiprocessing implementations suffer from the same issue, or is it JUST Firefox which is dealing with these countless bugs?
Lead Dactyloidae developer.
eUXP, UXP and Basilisk contributor.
Windows Server 2022

User avatar
Moonchild
Project founder
Project founder
Posts: 39510
Joined: 2011-08-28, 17:27
Location: Sweden

Re: e10s support question

Post by Moonchild » 2026-04-03, 08:55

Chromium suffers from the same.
"Praise from a narcissistic person is always a poison dart. They don't share the stage, so discernment matters." - Dr. Ramani
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Martok
Contributing developer
Contributing developer
Posts: 9
Joined: 2019-08-29, 00:46

Re: e10s support question

Post by Martok » 2026-04-04, 20:16

It's a bit off topic here, but if something is to be done against the freezes and virtual memory leaks, that time would be better spent on the garbage collector.
I've tried investigating this multiple times over the years, but the furthest I've gotten so far is that at some point the trace graph becomes complicated enough that the incremental GC does not get anything done before some action will upgrade the collection to a full GC anyway. And since it is a stop-the-world collector... well, it stops the world. What I'm less clear on is why even when collection finally finishes, the compacting doesn't really work at all (simple test: open youtube, wait a bit, close the tab, compare about:memory to virtual size). That makes me think major fragmentation on the jemalloc side of things, which then wouldn't be great for new allocations.
"For more information please reread."

User avatar
ownedbywuigi
Lunatic
Lunatic
Posts: 291
Joined: 2026-03-09, 21:48
Location: United Kingdom

Re: e10s support question

Post by ownedbywuigi » 2026-04-04, 22:38

Martok wrote:
2026-04-04, 20:16
It's a bit off topic here, but if something is to be done against the freezes and virtual memory leaks, that time would be better spent on the garbage collector.
Noted, will try to spend some time optimizing that in either Dactyloidae 13.1-pre3 or 13.2 for up-streaming.
Lead Dactyloidae developer.
eUXP, UXP and Basilisk contributor.
Windows Server 2022

User avatar
UCyborg
Board Warrior
Board Warrior
Posts: 1026
Joined: 2019-01-10, 09:37
Location: Slovenia

Re: e10s support question

Post by UCyborg » 2026-04-15, 16:50

TBH, PM still feels rather slow and laggy with my regular usage with maxParseThreads set to cpuCount.
The Merovingian wrote:Choice is an illusion, created between those with power, and those without.

User avatar
Basilisk-Dev
Astronaut
Astronaut
Posts: 675
Joined: 2022-03-23, 16:41
Location: Chamber of Secrets

Re: e10s support question

Post by Basilisk-Dev » 2026-04-16, 16:41

UCyborg wrote:
2026-04-15, 16:50
TBH, PM still feels rather slow and laggy with my regular usage with maxParseThreads set to cpuCount.
It's substantially faster for me on non-JIT builds. I'll need to test an x86 machine later.
Basilisk Project Owner

viewtopic.php?f=61&p=230756

User avatar
UCyborg
Board Warrior
Board Warrior
Posts: 1026
Joined: 2019-01-10, 09:37
Location: Slovenia

Re: e10s support question

Post by UCyborg » 2026-04-17, 03:20

It's just that things get slower the longer the browser is used. I cannot avoid this to get things done in real life.
The Merovingian wrote:Choice is an illusion, created between those with power, and those without.

User avatar
Basilisk-Dev
Astronaut
Astronaut
Posts: 675
Joined: 2022-03-23, 16:41
Location: Chamber of Secrets

Re: e10s support question

Post by Basilisk-Dev » 2026-04-17, 14:47

UCyborg wrote:
2026-04-17, 03:20
It's just that things get slower the longer the browser is used. I cannot avoid this to get things done in real life.
Are you saying it's getting slower with the helper threads adjusted or just in general with or without that patch? The reason I ask is that I am backporting a few Mozilla changes to improve performance including this one, and don't want to submit a PR if it's slowing people down.
Basilisk Project Owner

viewtopic.php?f=61&p=230756

User avatar
UCyborg
Board Warrior
Board Warrior
Posts: 1026
Joined: 2019-01-10, 09:37
Location: Slovenia

Re: e10s support question

Post by UCyborg » 2026-04-17, 16:12

In general. I don't think the patch by itself is bad, it just seems to be a small part in the bigger picture.
The Merovingian wrote:Choice is an illusion, created between those with power, and those without.

User avatar
ownedbywuigi
Lunatic
Lunatic
Posts: 291
Joined: 2026-03-09, 21:48
Location: United Kingdom

Re: e10s support question

Post by ownedbywuigi » 2026-04-23, 08:50

One more question (should make it a poll but you know)

Are you against multiprocessing in general or JUST e10s?

Considering doing a 'right' implementation of it, with just the UI being separate from the rendering, to only make the renderer freeze.
Lead Dactyloidae developer.
eUXP, UXP and Basilisk contributor.
Windows Server 2022

User avatar
Moonchild
Project founder
Project founder
Posts: 39510
Joined: 2011-08-28, 17:27
Location: Sweden

Re: e10s support question

Post by Moonchild » 2026-04-23, 10:24

ownedbywuigi wrote:
2026-04-23, 08:50
Are you against multiprocessing in general or JUST e10s?
There is no distinction! If you want to have multi-process use where the UI can interact with content (and you can have a working cache and permanent storage), then you MUST have an IPC messaging system, i.e. e10s (because that is what Mozilla called it). You can't be in favour of one and against the other; they are the same thing.
"Praise from a narcissistic person is always a poison dart. They don't share the stage, so discernment matters." - Dr. Ramani
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Nuck-TH
Project Contributor
Project Contributor
Posts: 351
Joined: 2020-03-02, 16:04

Re: e10s support question

Post by Nuck-TH » 2026-04-23, 14:58

I tnink question was about mulithreading and its conrast with e10s.

And yes, properly improving multithreading should be able to fix lockups without introducing issues that mutiprocess(e10s) is famous for.

Mozilla chose multiprocessing due to 2 things:
  • Chrome cargo-cult
  • Hope that OS process isolation will do security for them. Look how well that played out...

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1895
Joined: 2018-10-28, 19:56
Location: Georgia

Re: e10s support question

Post by athenian200 » 2026-04-23, 16:11

ownedbywuigi wrote:
2026-04-23, 08:50
One more question (should make it a poll but you know)

Are you against multiprocessing in general or JUST e10s?

Considering doing a 'right' implementation of it, with just the UI being separate from the rendering, to only make the renderer freeze.
Moonchild is definitely against all of it.

For me, though, Firefox's implementation is particularly bad even compared to say, Chrome... which I would say ironically did it first and did it better, even though I really don't like Chrome. The reason is this... Mozilla did not simply run one full browser process per tab, with all the processes ignorant of each other like a full-on virtual machine (which is the only remotely secure way to do it). That would have been very bloated and consumed a ton of resources, yes, but it might have at least been more sound than the architecture they wound up with, and I would have understood intellectually why they were doing it and thought it was a sound approach. Mozilla punched multiple holes in that sandbox and wound up trying to have their cake and eat it too, by splitting various browser components into their own processes that don't always get duplicated between tabs and reusing pieces where they could to try and regain performance, resulting in a ton of interprocess communication going on, which means they regress back to a pre-e10s state in terms of any claimed security advantage, and still have something a lot bigger and heavier than a non-e10s browser. So they've wound up with something that's big, heavy, and very vulnerable... but feels fast most of the time.

The narrative on their end is that they did it for security. The reality if you think about it, is that they obviously chased speed and multicore performance to point of sacrificing both security and extensibility of the browser in order to make it fast and take full advantage of multicore processors with a minimum of effort. Some of the performance achievements probably could have been gained with better thread scheduling or careful multithreaded programming... they go multiprocess, the underlying OS "does it for them" so to speak, and that's probably a bigger part of it than you'd think.

The way I look at it is this... Chromium, at least back when I was watching (don't know if it's still like this now)... did their version of e10s like a virtual machine, with each tab being a bit like running a different OS in VMWare. It ate RAM like candy, yes, but it was probably the most secure and sane version of this idea. What Firefox did in the end... was not that. They didn't create a virtual machine with a full browser process for each tab, ignorant of what the others were doing. They created something more like an operating system within an operating system, and it's awful... it resembles a kernel and a lot of subsystems a lot more than it resembles any kind of virtual machine nowadays.

Like... my opinion is that e10s could have been a lot more secure than it is now, if that were the real goal of the people implementing it. But it's become a bit too obvious over the years that their actual goal was offloading work to the OS and chasing multicore performance with minimal effort, while making excuses to cut features and reduce maintenance burden on themselves. They are obviously content to patch security vulnerabilities as they arise, even if their architecture is fundamentally flawed, despite all their claims to the contrary.

In short... the best way to do "e10s" of some stripe, if that's what you want... is probably to just to find a way to get an embeddable version of the browser building like K-Meleon did at one point, and then look at what SubWebView did to get a Chromium instance embedded into Pale Moon. Then just take that to its logical conclusion, and create a browser that only opens tabs to run embedded versions of other browsers, and doesn't render anything itself. Then you could just turn the browser into, effectively, a kind of manager of embedded instances of itself. The downside of this, though... is that you would likely be tempted to take the "next step" and attempt to make this feel like a single browser again, by having the embedded browser instances share information or feel more seamlessly connected to the UI of their container. But if you want real sandboxing, real virtual machine architecture... you can't do that, you have to leave it in this state, let it eat a ton of RAM, and deal with it not quite feeling fully connected to the UI of what its running in. Mozilla didn't, and the result is hack upon hack and even a new programming language that tries to design itself around solving problems like this without admitting any fault in the approach itself.

When Mozilla did their e10s, they copied Chrome's homework badly and changed it a little... seriously, look at the ipc directory. It contains code from Chromium adapted to Firefox in the hackiest way possible, and then remember they piled a ton of hacks on top of that architecture that they never really understood well enough to implement it themselves in the first place. What I would say about Mozilla, is sort of like what Malcolm said in Jurassic Park about the park itself:

https://www.youtube.com/shorts/HYh-rshkBf0

To misquote him as if speaking to Mozilla, "The problem with the multiprocess/e10s power that you're using here, it didn't require any discipline to attain it. You read what Google had done and you took the next step. You didn't earn the knowledge for yourselves, so you don't take any responsibility for it. You stood on the shoulders of geniuses to accomplish something as fast as you could, and before you even knew what you had, you hacked it in, and packaged it, and slapped it on a plastic lunchbox, and now you're shipping it, you wanna ship it. Well..."
"Linux makes everything difficult." -- Lyceus Anubite
"Linux is a cancer that attaches itself in an intellectual property sense to everything it touches. That's the way that the license works." -- Steve Ballmer
"We always overestimate the change that will occur in the next two years and underestimate the change that will occur in ten." -- Bill Gates

Kris_88
Board Warrior
Board Warrior
Posts: 1191
Joined: 2021-01-26, 11:18

Re: e10s support question

Post by Kris_88 » 2026-04-23, 16:52

In general, it would be logical to run the main UI in a separate thread. A web page shouldn't be able to block the entire browser. Mozilla got it wrong from the start, in my opinion. But the main problem is that the Java VM implementation is essentially single-threaded. Of course, you can run multiple threads, but these threads can't share objects. This isn't multithreading at its core. True multithreading begins when objects can be shared and there's automatic thread suspension when multiple threads access shared objects simultaneously. But it's not implemented that way...

User avatar
andyprough
Forum staff
Forum staff
Posts: 1515
Joined: 2020-05-31, 04:33

Re: e10s support question

Post by andyprough » 2026-04-23, 19:34

ownedbywuigi wrote:
2026-04-23, 08:50
One more question (should make it a poll but you know)

Are you against multiprocessing in general or JUST e10s?

Considering doing a 'right' implementation of it, with just the UI being separate from the rendering, to only make the renderer freeze.
We'll never exactly know what you will try until you try it, so why not? If it ends up being an insecure, ram hungry abomination, then we should find out pretty quickly. And if you do it correctly, then maybe we can move past Mozilla's errors after all these years.

User avatar
UCyborg
Board Warrior
Board Warrior
Posts: 1026
Joined: 2019-01-10, 09:37
Location: Slovenia

Re: e10s support question

Post by UCyborg » 2026-04-23, 20:46

What was written back in 2008 on Chrome's wiki page:
The JavaScript virtual machine was considered a sufficiently important project to be split off (as was Adobe/Mozilla's Tamarin) and handled by a separate team in Denmark. Existing implementations were designed "for small programs, where the performance and interactivity of the system weren't that important," but web applications such as Gmail "are using the web browser to the fullest when it comes to DOM manipulations and Javascript." The resulting V8 JavaScript engine has features such as hidden class transitions, dynamic code generation, and precise garbage collection. Tests by Google showed that V8 was about twice as fast as Firefox 3 and the Safari 4 beta.

Several websites have performed benchmark tests using the SunSpider JavaScript Benchmark tool as well as Google's own set of computationally intense benchmarks, which includes ray tracing and constraint solving. They unanimously report that Chrome performs much faster than all competitors against which it has been tested, including Safari, Firefox 3, Internet Explorer 7, and Internet Explorer 8. While Opera has not been compared to Chrome yet, in previous tests, it has been shown to be slightly slower than Firefox 3, which in turn, is slower than Chrome. Another blog post by Mozilla developer Brendan Eich compared Chrome's V8 engine to his own TraceMonkey Javascript engine which is newly introduced in Firefox 3.1alpha, stating that some tests are faster in one engine and some are faster in the other, with Firefox 3.1a faster overall. John Resig, Mozilla's JavaScript evangelist, further commented on the performance of different browsers on Google's own suite, finding Chrome "decimating" other browsers, but he questions whether Google's suite is representative of real programs. He states that Firefox performs poorly on recursion intensive benchmarks, such as those of Google, because the Mozilla team has not implemented recursion-tracing yet.
Chrome also uses DNS prefetching to speed up website lookups.
It's been 18 years since. Wasn't this a time when quad-core CPUs started taking off? Core 2 Duo was from 2006, Core 2 Quad series appeared by 2007.
The Merovingian wrote:Choice is an illusion, created between those with power, and those without.