Firefox To Get Multi-Process Browsing
An anonymous reader writes with news that multi-process browsing will be coming to Firefox. The project is called Electrolysis, and the developers "have already assembled a prototype that renders a page in a separate process from the interface shell in which it is displayed." Mozilla's Benjamin Smedberg says they're currently "[sprinting] as fast as possible to get basic code working, running simple testcase plugins and content tabs in a separate process," after which they'll fix everything that breaks in the process. Further details of their plan are available on the Mozilla wiki, and a summary is up at TechFragments.
What took so long?
Yeah! All they had to do was change their entire codebase from around 5+ years of Firefox (and probably more of Mozilla/Netscape) to update it! That's, what, half an hour's work? And don't give me this "legacy code" bullshit; if they bothered to anticipate our fifty bajillion core processors back then like any NORMAL person should today, they wouldn't be in this mess!
Lazy bastards. I mean, how hard is it to change what is apparently that one really trivial-to-find call in their code to useProcessSeparationOhAndIAlsoWantAPony(true)? Took them long enough...
Actually, they're talking about multiple processes, not multithreading. Threads all belong to a single process, which, if it crashes, will bring down all of its threads. Running the shell in one process, then each tab/window in its own process means that, much like Chrome, a single page can't bring down the myriad of tabs/windows you might have open, if you browse the web like I do.
-Matthew Riley "TofuMatt" MacPherson
I have a website
According to the Ars coverage:
It was probably too large a project to consider doing without a pressing need. Chrome and IE8 supplied that pressure.
The Rise and Fall of Online Community
Really. And all this wouldn't even be a problem if they just wrote it in Java to begin with.
This is why we can't have nice things.
So your single-core cpu is only ever capable of running a single process? The advantages of a multi-process browser go way beyond running the processes on separate cores.
Competition from Chrome was a good thing: first the Javascript improvements, now separate processes for the plugins.
Hands in my pocket
They had to chance a code base from around 5+ years only because they didn't things right 5+ years ago. Remember, back then they were doing a complete code rewrite anyway.
And no, the true reason to do this is not multicore. That it also gets faster on multicore is just a nice side effect. The true reason to do it is stability. If one page makes problems, you don't lose all the others. This was indeed even more important back when browser and mail was the same program, because it meant that a page crashing your browser could destroy your almost-completed email, too (yes, this has happened to me, although I'm not sure if it was still old Netscape or already new Mozilla). Of course, today it's quite possible that your browser is your mail client again because you're using webmail.
Note that if it were just a performance thing, they could have gone multithreaded instead. This would probably get even better performance.
The Tao of math: The numbers you can count are not the real numbers.
The clowns working on Firefox had years, YEARS, to get their act together and rewrite the STINKING PILE OF SHIT that is the Firefox codebase. But they chose to flame anyone who dared talk about the massive architectural problem in the absurdly outdated Firefox process model.
Memory protection for each tab? Not possible! Stop asking for something that can't be done! They cried!
Threading for Javascript? Not possible! Stop asking for something that can't be done! The Firefox devs cried!
That is why those AC posts from Firefox devs were so vicious and venomous for everyone pointing out the massive memory/resource leaks in Firefox that have only been somewhat lessened in the latest versions. The solution for those problems involves a complete rewrite of the process and memory model for Firefox.
Now Google came out and humiliated the Firefox devs with Chrome and its amazing realworld threaded Javascript and memory and process protection/isolation.
Nothing but pity and absolutely no sympathy for anyone faced with retrofitting Firefox into a semblance of a modern browser architecture.
Now with full extension support in Chrome this is like hearing about Microsoft scrambling to fix their massive security problems in IE long after you dumped it.
This isn't really about CPU/Core counts, having tabs/plug-ins running in a separate process is useful because if that page/plug-in crashes that process, the remaining pages won't be effected. I highly doubt they will be dabbling with being able to set which processor a certain process runs on (just yet).
This won't really make use of extra processors/cores, that's what threads (should) already do, even if the application doesn't have any special code to do so.
Yes, back in the days when a bad web page would crash your browser this was bad, but I have not seen those crashes recently.
Do you run a lot of plug-ins, by any chance? Browser makers don't control plug-in code (other than the code for their own plug-ins, of course), but this code is still capable of taking out a browser process if it goes bad.
If the browser is stable, what benefit do multi-processes have?
The other big benefit is that one process can't hog the CPU: even if one page gets into a ridiculously tight JavaScript loop that bogs that page down, the others should continue to load.
Still, the "if the browser is stable" issue is a very big if, and as I mentioned above, it's not completely under the browser maker's control.
Also, and maybe I should read the details, but if I am authenticated to a website in one tab, does that authentication carry over to other tabs using other processes?
It depends on how the browser is written, but it can be done.
It was probably too large a project to consider doing without a pressing need.
Cuz yeah, Flash locking up the entire browser wasn't a pressing need until IE8 and Chrome. Riiiight.
LOTS of us have been asking about this for a VERY long time (years). Leaving it this late is called 'lack of vision'. This should've been in the very first version. Now there IS a ton of code to make this work with. I imagine that's why they call this Electrolysis...it's a hairy problem now that it's been ignored for so long.
I'll bite. It's about time.
Even explorer.exe is able to open directories using different processes, if you want. Frankly, I found it frightfully annoying to have X+ tabs open and have ONE of those tabs cause the entire program to crash, usually due to a plugin issue. Made no sense to me. Multi-process/multi-threaded/multi-whatever programming has been around for quite a while now, and multi-core cpus have been pretty common, too.
It's one of the huge advantages that I saw with Chrome (over Firefox). That and program open/new tab open speed. FF 3.5 seems to have addressed this somewhat, but it's still slower, I think.
Hooray for competition, and hooray for finally taking advantage of the hardware out there. Really, for one of the most used applications someone will use, it seems silly to only allow it to use a single-process model.
One way to implementing multi-process Firefox is first allow XPCOM to work across process. i.e. allow objects to be via XPCOM that are actually spawned in another process, one explicitly created for the task. In COM it had a thing called a running object table (ROT). When you create a process hosted object it looks to see if one is running already, and if not it uses the registry info to spawn one. Then it waits for it to start and then it tells the process to create the object, sets up all the marshaling etc. XPCOM could do something similar, though it would have to do so in a cross-platform manner. I assume that Firefox would have to determine when creating a browser object first if it was chrome or content, and if it was content to spawn a host process and then set up the interfaces. Once set up and assuming the interfaces were efficient, the effect would be largely transparent.
The biggest performance hit would probably be on anything which tried to call or iterate over the DOM boundary between chrome and content. For example chrome which introspected content would suffer because all the calls would have to be serialized / deserialized.
Personally I think its feasible but it would hit performance. An alternative would be to just host plugins in another process. Windowless plugins might be a pain to implement but at least you could kill the other process if a plugin goes nuts which seems to happen all too frequently for me.
The machine I'm currently on is a single core machine running XP (1.6 GHz if I'm not mistaken...so lazy I don't even want to pull up the specs!). I've been using Chrome for months on this thing and it's lightning fast. Your concern over speed is unfounded.
This is a pretty ungenerous view to take. First off, the Mozilla community is not confined to geeks on Slashdot who care passionately about things like process separation. The Firefox developer community most certainly does care about its users, but the users don't necessarily know that they want, much less could benefit from, process separation. Like Henry Ford said, "If I had asked people what they wanted, they would have said faster horses." So, Firefox developers delivered what the mass base of users wanted. If anything, you might fault them for being overly user-driven. We can see this in their focus on adding new features, instead of leaving the trivial features as extensions and focusing on performance, standards implementation, and technical features like process separation.
The Rise and Fall of Online Community
OK I'm a user, and I want a browser where the UI doesn't lag when pages are loading. I also want a browser that doesn't completely freeze when a Java applet launches or PDF file opens. I would also like a browser where I don't have to restart the whole thing when Flash gets borked and refuses to play youtube videos.
Point being there's a lot of user-visible issues and longstanding complaints which are addressed by this. Furthermore, the incumbent browser (IE) doesn't have any of these issues.
(And "Use Adblock and stop using Java/Flash/PDF" is a workaround, not a real solution.)
Business. Numbers. Money. People. Computer World.
Yes, they were. TraceMonkey was started in earnest in early summer 2008. Chrome was (accidentally) announced 1 September 2008.
The Rise and Fall of Online Community
Ask your admins to change the proxy PAC to not using the isInNet function, as this
requires the DNS to check if every domain/hostname exists before deciding what proxy
to use... isnt easy to solve...
i work around with this:
if ( shExpMatch(url, "*127.0.0*") ||
shExpMatch(url, "*192.168.*") ||
shExpMatch(url, "*10.15.*") ||
shExpMatch(url, "*10.16.*") ||
shExpMatch(url, "*10.17.*")
){ if ( isInNet(host, "127.0.0.0", "255.0.0.0") ||
isInNet(host, "192.168.0.0", "255.255.0.0") ||
isInNet(host, "10.15.0.0", "255.255.0.0") ||
isInNet(host, "10.16.0.0", "255.255.0.0") ||
isInNet(host, "10.17.0.0", "255.255.0.0")
) { return "DIRECT"; }
else { return "PROXY 192.168.1.10:3128"; }
}
this way it just use the "bad" function if there is a IP in the URL...
all rest, its defined using domains/hostnames, no need for the isInNet
good luck
Higuita
> First off, the Mozilla community is not confined to geeks on Slashdot who care passionately about things like process separation. The Firefox developer community most certainly does care about its users, but the users don't necessarily know that they want, much less could benefit from, process separation.
That's the same group of developers who wilfully ignore repeated ordinary user requests to give them an option to accept duplicate certificates, even after some big red security warning. To make things worse, it doesn't even bother to display which certificate and which CA are in violation so the user can delete them. On IE, you can click "Continue anyway" to bypass the self-issued certificate duplication and log on to your router, for example.
Their response: it's the fault of your router company.
This is ridiculous. The Mozilla devs definitely think they know better than the users.
Note that if it were just a performance thing, they could have gone multithreaded instead. This would probably get even better performance.
Firefox is already multithreaded (if it weren't the UI would freeze during downloading, rendering, etc).
It amazes me how many people here on slashdot don't understand the differences and distinctions of multi-process vs. multi-threaded.
Similes are like metaphors
My firefox actually does freeze while rendering a page. It's mostly obvious on my slower linux box. Not that I'm disputing its multi-threaded nature, it clearly *can* do two things at once, just not the things I need it to do (like load slashdot while allowing me to click back to another tab).