Subframe: Facebook using over 100% CPU

EDIT: Evtl solution from ChatGPT: Add this to custom filters in shield:
||facebook.com^$subdocument,domain=~facebook.com

Description of the issue:
I always keep https://www.facebook.com/messages/ open, but I notice it regularly uses over 100% of the CPU & I have to quit it.

How can this issue be reproduced?

  1. Open: https://www.facebook.com/messages/

Expected result:
Facebook should not use over 100%

Brave Version( check About Brave):
Version 1.47.171 Chromium: 109.0.5414.87 (Offizieller Build) (arm64)

Additional Information:

158% is not 100% CPU in Chromium task manager, how many CPU cores do you have? because each 1 CPU core = 100% so depending on your CPU core count, it can be nothing or almost nothing. but 158% still would be “1 core and a half” being used, so unless you had 2 core CPU, or maybe 4 cores, I don’t see the problem.

Facebook has too many garbage scripts, so even with Adblocker it is slow and crap, especially messages since they made it a whole messaging to be used with FB messenger app.

About the subframes, it is normal, and it is one of the security measures Google added to Chromium to fight against vulnerabilities, It is called Site Isolation, so by the name you can see what it does.
It can be disabled but some sites seem to need it to work properly, well I have notice the ones that check if ‘your connection is secured’ especially, like cloudflare have problems if you don’t enable it.
There is also sandboxing which uses more resources to secure the browser.

You can remove them if you run brave with --no-sandbox and/or --disable-features=IsolateOrigins,site-per-process but not recommended.
You can also use the flag brave://flags/#site-isolation-trial-opt-out (which I think uses --disable-site-isolation-trials to disable the site isolation)

The problem is Facebook is crap, you can run extensions like FB Purity and it will still be terrible slow website, just a tiny little bit better.

Yeah, those are settings I don’t want to mess around with.

I’m on an 8-core M1 Pro, so it only heats up from 40-50°C to 60°. I’m mostly worried about battery life, I don’t want it to s*ck everything away unnoticed.

But I don’t remember having this issue on my old 2-core MacBook Air. I had an issue where Logi Options+ would use over 190%, which would max out both CPU cores & therefore it would get over 90°. An update fixed that.

Well, you are using only 19% of your 100% CPU if you have the 8-core, so that’s pretty much nothing.
That’s why using ‘average’ CPU % for total of CPU usage is really bad, it’s not like it is showing you the real usage per core, so Windows does it right by using 8 cores = 100% and Chromium and whatever OS are doing it dumb.

And well, Brave (because of Chromium) added two flags,

chrome://flags/#battery-saver-mode-available
chrome://flags/#high-efficiency-mode-available

And you enable it here and can have exceptions for sites brave://settings/performance

That will puts the tabs to sleep, the problem is as you can see by the ‘high efficiency’ one is that times are bad, by default it is 1 hour, and then 5 seconds to 2 minutes only, not even 30 minutes or 15 minutes or something better.
It is a good thing it exists natively in Chromium, since Developers can use some features to work with it and make the experience of ‘discarding’ tabs better https://developer.chrome.com/blog/memory-and-energy-saver-mode/

But 2 minutes is too short and 1 hour too long.
There is a way to override the time, hack it if you want to call it like that, you don’t enable the high efficiency mode flag and then start Brave from terminal with --enable-features=HighEfficiencyModeAvailable:time_before_discard/XX and replace the XX with 10s or 10m or 10h, whatever you feel is right. (wonder why they don’t let us just input the value and done, instead of having bad presets), that’s how easy you override those bad presets.

Of course, this is crappy (I don’t mind it but I know not everyone is willing to do it), so, if you wand more control and a better experience, use an extension, but that by itself will use ram and well, extensions can be extensions, like there was a Tab suspender extension that was removed for having weird crap (The Great Suspender), all they do is discard tabs which you can manually do in brave://discards/
in discards page, besides controlling and seeing a bunch of stuff about tabs, you can have access and toggle the battery saver mode on as well.
High Efficiency mode is the ‘discarding of tabs’ and Battery saver is the one that only works on laptops after 20% (https://blog.google/products/chrome/new-chrome-features-to-save-battery-and-make-browsing-smoother), so there is a mismatch in terms from discard page and performance page.

This is the one I ended up using in another computer when TGS was removed from store:

Then there are others like:

This last one is TGS but it was released without the malicious code (you have to trust), but it never gets updates anymore, but discarding is simple, not like it requires updates everyday.

But this way you can help your computer to use less resources when you are not even using websites.
Brave/Chromium have backgrounding of tabs and all, like they are put in low priority mode, if videos are muted/don’t have sound, the videos will be paused if in the background.

Since you don’t want to lower your security (which you shouldn’t even if it uses more resources), then discarding tabs is the best way to use less resources.

Also, I don’t know if you have tested it but chrome://flags/#enable-force-dark could help with battery life since less white = more battery life.
The better mode in my opinion is Enabled with simple CIELAB-based inversion but it is still not perfect.
There are some extensions like Dark reader but more extensions = more resources, especially one that will run on every website by default.
Native dark mode web contents will also not override if a page has dark mode, smartly detects it is already dark, so it does nothing, of course, it can be bad for some websites but I would rather have dark mode for 99% of decent websites than think about the problematic 1% that I can still fix by using the adblocker.

Facebook probably has dark mode (haven’t used FB in years) so this would be for other websites where dark mode is not enabled by default or not available, but should help some battery life.

Anyway, Facebook will always be garbage, but battery life can be improved.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.