High CPU usage on certain website

Sven's Avatar

Sven

14 Jan, 2017 07:20 PM

Hi!

I have the problem that a website I'm spending quite some time on leads to quite some CPU usage of TenFourFox even when apparantly idling (~70-90% on my normal, full profile and ~50-70% on an empty profile) which worries me a bit since it might be that continiously high CPU usage had already lead to the heat death of my previous PowerBook.
The website in question is https://www.fanfiction.net/ or more precisely any story (e.g. https://www.fanfiction.net/s/11049179/1/Frozen-Destiny).
Once I change the tab to something else that definitely uses less CPU (e.g. the TenFourFox start page) then the CPU usage of TenFourFox drops to around 5%.
Also if I use the NoScript add-on the CPU usage drops to 5% as well (so it seems to be related to some script) however then the layout of the story is incorrect (all text is centered) and posting reviews would probably not work either.

I'm using a PowerBook G4e with 2 GB RAM and Mac OS X 10.4.11 with TenFourFox 45.6.0 7450 (though the issue already seems to exist for some versions; I haven't really paid attention to it).

Regards,
Sven

  1. Support Staff 1 Posted by Chris (chtrusch... on 14 Jan, 2017 08:00 PM

    Chris (chtrusch)'s Avatar

    I can replicate the high CPU problem at https://www.fanfiction.net/s/11049179/1/Frozen-Destiny%29 even when the site seems to be idle.

    There are four possible solutions at least:
    1) Install G4FanControl, which I would recommend for all G4 notebooks, and set the temperature values to 10 °C below the defaults: https://github.com/andreafabrizi/G4FanControl
    2) Use Adblock, Inspector or any other tool to find the offending scripts that use up the CPU, block them and hope the site still works afterwards.
    3) Use YesScript or NoScript to block JS (YesScript is nice because it's uncomplicated and lets you switch on JS if you need it very easily)
    4) use Reader Mode to read stories (the little book icon in the URL bar)

  2. Support Staff 2 Posted by Cameron Kaiser on 14 Jan, 2017 08:08 PM

    Cameron Kaiser's Avatar

    I can also replicate this, but unfortunately I think this is a limitation of our aging hardware. The page appears to run a "save script" every two seconds, which is why switching away from that tab reduces the CPU usage -- TenFourFox/Firefox diminishes the priority of timers on background tabs to save cycles. The impact seems to be CPU-related. On my MacBook Air the computer can keep up, but the Quad G5 jumps to around 40% utilization and on my 1GHz iMac G4 it does indeed run up as high as 90%. The code is embedded in the HTML itself, so it is probably difficult to block only the timeouts.

    Please note I don't know if that's the only cause of what's going on with that page. That said, two second timeouts over and over just to save your reply seems a bit excessive even on a modern PC, so I might ask the site owner to consider backing that down a bit. You can point them to this thread if you like.

    I agree with Chris that installing G4FanControl is a good idea anyway. I had an iBook G4 cook itself to death too.

  3. 3 Posted by Alasdair on 26 Jun, 2017 04:00 AM

    Alasdair's Avatar

    Bit late to this, but in trying to debug why fanfiction.net was causing my (completely unrelated to tenfourfox) browser to go crazy it was the one result that came up in Google, and figured I'd better share my solution for anyone else who gets the same problem

    It turns out the problem is NOT the javascript checking for reviews every two seconds, but an SVG animated spinner for Google Translate that for some reason is constantly (about every 15ms) causing the page to redraw, even if it isn't visible.

    If you're using uBlock / Adblock / another compatible adblocker, and assuming you don't actually USE Google Translate, the following rules in your custom filters should solve the problem (in short by blocking google translate):

    translate.google.com
    translate.googleapis.com

  4. Support Staff 4 Posted by Cameron Kaiser on 28 Jun, 2017 01:15 AM

    Cameron Kaiser's Avatar

    Very interesting. There might not be a whole lot I can do about that, unfortunately; SVG is taxing to animate without hardware acceleration (which we can't enable for various technical reasons with the 10.4 SDK).

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac