7

Certain websites cause Firefox to continuously use 100% CPU. Some of them I can just block and never visit, of course, but some others I unfortunately need to use sometimes.

I want to combat that, and the first step is to identify offending JavaScript code (or maybe some other offending resources, who knows), after that it might be possible to selectively block/auto-rewrite these parts or maybe press authors to fix issues in their code.

But how do I do this? Firefox DevTools have a performance inspector, but it seems to only record frame rendering times, response time, etc, I couldn't find information about where real CPU time is spent, and it is also limited to single tab, as far as I could tell.

Update

I tried disabling all extensions and it showed that they do not cause 100% CPU usage.

Update 2

I already use uBlock Origin. Also tried some coarse blocking of scripts by 3rd party domains for problematic website (using this extension), but in my case it either stays as is or breaks completely. So I need to somehow profile javascript globally to see which function(s) gets crazy run time.

13
  • does the same thing happen in other browsers?
    – Blaine
    Commented Feb 11, 2017 at 13:19
  • 1
    I would disable all browser plugins to prove it's nothing you're in control of. If it still happens, the first thing might be to just run Process Explorer. If you look at the threads tab of the firefox.exe process, you can sort by CPU column. What does the stack look like? Interesting modules on it, always the same, etc...I would install Debugging Tools for Windows (SDK) to get the latest dbghelp.dll - reference that in ProcessExplorer. Mozilla make their symbols available. This is just a starting point and viewing the problem from a general process running on the OS point of view. Commented Feb 11, 2017 at 13:33
  • @Blaine didn't try it yet, but using a different browser is not an option for me (beyond testing purposes). I'm trying to solve the issue in Firefox. Or some other browsers have more refined developer tools which could help finding the problematic data in websites? Commented Feb 11, 2017 at 13:35
  • @EMK good suggestion, I will try disabling extensions. (I already don't use any plugins). I'm not using Windows, and ideally searching for cross-platform solutions. Right now I'm on macOS. I can't see CPU usage of individual threads in Activity Monitor, maybe it would be possible to see in command line utilities (top)? Just running top seems to give very incomplete info… Commented Feb 11, 2017 at 13:39
  • 1
    I've had a few sites that drive me crazy. For one site, anytime they used this font website in their jscript, even my quad processor went to 100%. The fix was to add four new HOSTS file entries, [example = 127,0,0,0 block.com] for: "fonts.com" and "fast.fonts.com" (I also added "www." to these URLs). Next fix for most everything else, like wunderground.com, is to simply add the extension, "UBlock Origin", which is amazing.
    – DaaBoss
    Commented Feb 11, 2017 at 15:56

1 Answer 1

5

You can use about:performance to track down the offending tab and then use Ublock's logger to track down what is causing the high CPU.

That's how I found out how an embedded youtube video caused problems because it kept loading www.youtube.com/yts/jsbin/player_*************/en_US/remote.js even though I had autoplay disabled.

In this case, I would have found it even faster if I had set Ublock's logger to all (i.e. all tabs) instead of one particular tab.

Since you mentioned Ublock but not the logger, this might be of interest.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .