Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 04, 2016, 10:37:06 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Firefox CPU usage  (Read 2864 times)

TaoPhoenix

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,550
    • View Profile
    • Donate to Member
Firefox CPU usage
« on: December 21, 2012, 11:06:04 AM »

When I open new webpages, especially about 4-5 in a row, my cpu usage slams through the roof in Firefox. Is that normal? Do modern webpages use a lot of client-side rendering to save on server overhead? Or should I look at one of those alternative Firefox builds again?


rgdot

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 1,879
    • View Profile
    • Donate to Member
Re: Firefox CPU usage
« Reply #1 on: December 21, 2012, 11:30:27 AM »
Firefox high CPU and RAM usage is as old as the internet  ;) Every version promises improvements, to me the closest thing that comes close to helping is blocking flash as that seems to one of the biggest culprits.

Alternatives haven't made much of a difference to me.

Cloq

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 268
    • View Profile
    • Donate to Member
Re: Firefox CPU usage
« Reply #2 on: December 21, 2012, 12:38:52 PM »
Interesting.. I recently had a similar problem, in my case the issue turned out to be that my "prefs.js" file in my firefox profile folder, had ballooned to 250+ MB. My assumption is that somehow it was corrupted. I restored a backed copy of it (150KB) and now Firefox is zippy again, no high cpu/mem usage.

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 6,137
  • Slartibartfarst
    • View Profile
    • Donate to Member
Re: Firefox CPU usage
« Reply #3 on: December 21, 2012, 08:15:41 PM »
My experience of Firefox (I have the latest version auto-updated via the ß channel, and FF is set to auto-feedback to the developers) is that FF is usually rock-solid, and ß updates are released rapidly if the developers become aware of any problems in a release. Otherwise, if anything seems to go "wrong" with FF, it is invariably something peripheral to the application. Typically, one or more of the add-ons have not been able to be updated to keep in step with the latest ß version.
As an example, I have had some recurring and annoying problems with tabs for months, and after the latest ß update they got really bad. In desperation, I disabled half of the add-ons (including all the add-ons that affected tabs) and then progressively re-enabled them. The problems entirely disappeared, and I have no idea why.

As for speed, FF seems to be very fast. FF occupies little CPU, and because I run cache from RAM it is made even faster - or at least as fast as it could probably be. As I write this, FF CPU usage is flickering between 0-2% (max). I have 7 tabs open, 3 of which are permanently pinned/open - the Add-ons page, Gmail, and Google Reader.
Bandwidth doesn't seem to be a problem. I normally use a wifi access (n-type 802.11n) to connect to the router. On the odd-occasion I have tried a cable connection to the router, the response time seems pretty much the same either way. I haven't properly tested the current configuration's up/down load speed limits via wifi and cable.

TaoPhoenix

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,550
    • View Profile
    • Donate to Member
Re: Firefox CPU usage
« Reply #4 on: December 21, 2012, 08:33:32 PM »
As I write this, FF CPU usage is flickering between 0-2% (max). I have 7 tabs open, 3 of which are permanently pinned/open - the Add-ons page, Gmail, and Google Reader.

Hi Iain,

In this particular thread case, it's about opening new pages. If I open about 4-5 of them in a row, my CPU gets slammed while they all try to render. Usage does tend to go down later, it's just about new pages, because it lags the whole comp while it renders out.


IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 6,137
  • Slartibartfarst
    • View Profile
    • Donate to Member
Re: Firefox CPU usage
« Reply #5 on: December 22, 2012, 12:11:17 AM »
I opened a single new tab just now and FF momentarily popped up to 13%, and then back down to it's usual 0-2%.
When I initially start up FF it usually opens about 5+ pages (3 pinned + 2 or more unpinned, all from the session as it last closed), but I have it set to load tabs in background and it doesn't seem to lag.
Maybe there would be a lag if I had not set it that way.(?)
I shall experiment a bit and see.

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,473
    • View Profile
    • Donate to Member
Re: Firefox CPU usage
« Reply #6 on: December 22, 2012, 12:42:47 AM »
Palemoon 15.3.2 hits about 13% loading 6 tabs at once - I got it to hit 15% by opening 19 tabs at once, (Phenom 6 core).

Do you have hardware accelerated rendering enabled?

Options->Advanced->General->Use hardware acceleration when available


Just as a matter of interest, opening 65 tabs in Firefox 11.0 x86 on an Athlon 235e caused CPU to peak at ~50% until the tabs were loaded.

TaoPhoenix

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,550
    • View Profile
    • Donate to Member
Re: Firefox CPU usage
« Reply #7 on: December 22, 2012, 07:08:23 AM »
Thanks for the suggestions guys.

I do have hardware acceleration on FWIW.

However, In other days I had used copies of PaleMoon and I had run into other lag type problems so I went back to generic FF. (There have been related problems where I got lags simply scrolling up and down existing pages.) Though it would not hurt to re-try that branch again and see if their other improvements have caught up and helped.

I did discover a lot of old program-files folders custom saved back when I had about 4 versions of FF going t once (regular, Aurora, Nightly, and PaleMoon) so I deleted some cruft yesterday. So I'll keep fiddling and see what happens.

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 6,137
  • Slartibartfarst
    • View Profile
    • Donate to Member
Re: Firefox CPU usage
« Reply #8 on: December 22, 2012, 08:31:45 AM »
I opened 8 more tabs in quick succession just now, and FF v18.0 beta presented no probs/lags (tab load in background).
I suspect that the lags you are experiencing may be peculiar to your configuration.

TaoPhoenix

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,550
    • View Profile
    • Donate to Member
Re: Firefox CPU usage
« Reply #9 on: December 22, 2012, 08:54:29 AM »
Good to know.
I opened 8 more tabs in quick succession just now, and FF v18.0 beta presented no probs/lags (tab load in background).
I suspect that the lags you are experiencing may be peculiar to your configuration.


Good to know. By now it looks like my rig has a few quirks, but if it's "just me" at least I can try to fiddle some more to fix them.

TaoPhoenix

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,550
    • View Profile
    • Donate to Member
Re: Firefox CPU usage
« Reply #10 on: December 22, 2012, 01:34:00 PM »
I have a bit more data.

Both AdBlock and Simple AdBlock seem to chew up some CPU power doing their thing.

I took a hand at putting in a trial of AdMuncher + Ghostery again after I took it out for other reasons, and I am def. seeing a CPU improvement. I don't expect miracles, but maybe the AdBlock type addons have to examine the page to see what to block, and Monster.com according to Ghostery is a pretty heavy page. (Facebook Connect?! Eew! And other barely less evil pulls.) '

Edit: I'm back on Mainline 17.01, not Beta 18.0, not that I think it really matters.



« Last Edit: December 22, 2012, 02:19:46 PM by TaoPhoenix »

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Firefox CPU usage
« Reply #11 on: December 22, 2012, 06:42:34 PM »
I haven't looked at how Ghostery does it's blocking, but AdBlock uses regular expressions - the more blocklists you've added, the more regexes it has to chew through. Some REs are (relatively) cheap, some can be very expensive - so the time ABP chews up depends a lot on the nature of your blocklist.

Dunno how exactly ABP works with firefox, but in theory it only has to look at HTML content - AdMuncher has to intercept all HTTP traffic and parse it - and I'd expect it to work with regexes as well. So if you fed it the same the exact same blocklists as ABP, it ought to be slightly slower.

The above is purely guesses, though, AM might well be implemented differently or have a more efficient regex engine. I do seem to recall that the developer used to frequent some of the same IRC channels as me, which indicates an obsession with efficiency :)
- carpe noctem

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,473
    • View Profile
    • Donate to Member
Re: Firefox CPU usage
« Reply #12 on: December 22, 2012, 07:01:29 PM »
If you type about:about in Firefox you'll get a list of About, (DUH!), pages you can look at for possible diagnostic info.

eg.
about:cache   (current cache in use)
about:memory (memory being used by FF processes and each page open)
about:support (diagnostic info, what's enabled, etc)

2012-12-23_11-47-39.pngFirefox CPU usage

Dunno how exactly ABP works with firefox, but in theory it only has to look at HTML content - AdMuncher has to intercept all HTTP traffic and parse it - and I'd expect it to work with regexes as well. So if you fed it the same the exact same blocklists as ABP, it ought to be slightly slower.

Wouldn't there be more of hit with ABP since it has to use FF/PM/etc to get the pages, then parse them and is written in Java, (I think - probably wrong), whereas AdMuncher could be written in a more efficient language and applies the RegEx as it streams data through its proxy?

(I don't know, just wondering.)
« Last Edit: December 22, 2012, 07:07:42 PM by 4wd »

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Firefox CPU usage
« Reply #13 on: December 22, 2012, 07:28:43 PM »
Wouldn't there be more of hit with ABP since it has to use FF/PM/etc to get the pages, then parse them and is written in Java, (I think - probably wrong), whereas AdMuncher could be written in a more efficient language and applies the RegEx as it streams data through its proxy?
JavaScript, not Java! - the two have almost nothing in common. (I'd say java is generally a bit more efficient than JS, but JS JITters have improved a lot lately, and benefit from being directly baked in the browser rather than launching a separate VM and all that) - and while C++ (and assembly, as parts of AM is afaik) can be truckloads more efficient than other languages, browser extensions have access to a more direct representation of what's going on, whereas AM works as a proxy that has to do extra parsing - and, at least in theory, the really heavy-lifting work (the regex engine) of ABP could easily be implemented in lowlevel code (probably builtin firefox library?).

There's a lot of guesstimates in the above, though, and I could very easily be wrong! - at any rate, a long list of sloppy regexes are going to kill performance no matter what the underlying language is :)
- carpe noctem

MrCrispy

  • Participant
  • Joined in 2006
  • *
  • Posts: 331
    • View Profile
    • Donate to Member
Re: Firefox CPU usage
« Reply #14 on: December 23, 2012, 08:10:16 PM »
I wish Firefox had a SIMPLE counter about memory and cpu being consumed by each tab/extension/window. Not sure if this is possible without each tab being an individual process (which leads to the Chrome nightmare of multiple running exe's), and even then XUL is still shared right?

The current situation is unmanageable. I am a heavy user - right now I have Waterfix x64 with about 60+ tabs (out of which about half are loaded), 20+ extensions. a bunch of styles and scripts etc. This is on a fairly decent pc - Q6600 with 6GB Ram, so it shouldn't slow down. Yet, completely out of the blue, cpu will spike to 40-60%, then fall back sometimes, other times it stays high.

The only 'fix' is to restart the browser (which causes everything to be unloaded except 1 tab), and play the extension game - selectively enable/disable each one, and restart. This is not fun.