Mozilla is currently testing Electrolysis (or "e10s") [1] - their project to run web content in a separate process - on nightly, and I've been using it for the past few weeks. It's getting pretty reasonably stable, so hopefully we'll see it in a release version soon enough. According to [2], the tentative plan is for Electrolysis to be released with Firefox 36.
I could survive without processes-per-tab, if Firefox gave some hint – any hint! – which tabs are being naughty. Maybe just a per-tab counter of allocations, or timeouts, or DOM edits, or some other operation? Anything that serves as a proxy for "more active than average while not in foreground".
Yeah, Firefox really needs some sort of "top". Right now, idling, my Firefox is taking between 20% and 40% of my CPU. I'm sure it's some tab running some dumb javascript, but there's no way for me to figure out which one. Sad, because spidermonkey must know which window a javascript context is associated with, so it could feasibly keep track of run time.
Yeah, but it knows the global "window" object. That's enough for it to keep track of stuff. Let the browser correlate that global object with an actual UI window/tab.
If a script hangs, Firefox has a little popup on that tab that asks if you want to kill it or let it keep running. So something in the browser knows which tabs are JS-intensive.
Sure. That particular setup has pretty low overhead and hence also low granularity; it's not measuring intensive or not but just how long a script has been running when a timer on a background thread fires. So your script could be eating up all the CPU but just returning to the event loop every few seconds and the hung script dialog would never notice.
Use the profiler in the developer tools. Run it for a short while (e.g. 10 seconds) and look at the results. The tab using the most CPU resources will be at the top of the result tree.
I just gave it a try in a current, Firefox-not-being-sluggish state, and it seems it may be a bit hard to correlate profiler lines to exact tabs. (For example, 7 of the top 13 rows that had domains associated were Google-API-related, but I don't think they're being used from Google pages...) Still, when I next enter a laggy state perhaps this will help finger the culprit(s) unambiguously. Thanks!
As soon as firefox gets per process tabs in stable I'll switch back
As strange as it sounds, this is a reason why I don't use chrome as my "default" browser. I seem to find the web sites that leak resources and leave them open in tabs (one of my projects at work is a big culprit too). With firefox a runaway tab or two simply results in a single CPU pegged at 100% and max about 2GB of ram consumption. With chrome it will peg out a couple CPU's and eat RAM until my machine goes into swap. Usually this happens while I'm gone so simply unlocking the screen is a painful process as everything gets swapped in.
In other words I prefer having to kill firefox on a regular basis because its run out of RAM, than to have to reset my machine because its taking 10 minutes to unlock the screen.