Author Topic: Browser memory and cpu loads  (Read 7141 times)

0 Members and 1 Guest are viewing this topic.

Offline Leslieann

  • * Elevated Elder
  • Thread Starter
  • Posts: 4519
Browser memory and cpu loads
« on: Mon, 11 November 2019, 19:48:38 »
So about 2 weeks ago Naweo asked about how to build a system that could run a bunch of Chrome tabs, you can find the discussion here.

To summarize, Naweo wanted a system that could run a ton of Chrome tabs and I basically said it wouldn't happen due to how Chrome was written and just how the net ran. Some of my initial ideas were wrong (old information), but for the most part my advice was correct, just not the why. In the end I questioned if it was a problem with Chrome or was it due to the load itself and a quick test kind of confirmed it was a combination of the two but never answered if it was exclusive to Chrome. Today we answer that.


Testing low load

I loaded up an instance of Endeavour OS Linux, the spiritual successor to my favorite distro, Antergos.  I was initially going to use Win8, however my Win8 VM decided to crash very early into testing, Mint Linux was considered but getting all of these browsers on it took too much effort so an Arch based distro (which I'm now more familiar with) was my go to.  Testing was done with  6 core with 8 and 16GB of ram, I setup each browser to have the same two home pages to start with, in this case Neweg.com and Slashdot.org. Newegg has lots of flash and internal ads while Slashdot has lots of external flash and text ads. The idea being I wanted dynamic but stable content. Too much content change, such as a news site, could alter the results. I opened one browser noted numbers then restarted and tried the next.

Note, Chromium is the open source browser that Google Chrome and Brave is based on. Google takes Chromium and further adds their own tracking and telemetry along with APIs for other Google services. Brave takes Chromium and further removes anything Google and tracking/telemetry related. All were installed with defaults. Adblocking on Firefox was done with ublock Origin.

Two pages/tabs, single window 8GB ram:
Chromium          750MB
Brave            530MB
Google Chrome         797MB
Firefox            640MB
   with adblock      614MB


Two pages/tabs, single window 16GB ram:
Chromium          687MB
Brave            569MB
Google Chrome         760MB
Firefox            655MB
   With adblock      642MB


Some interesting numbers here. Google Chrome and Chromium went down on ram use going to 16Gb while Brave and Firefox both went up. This may be that they are tuned to take advantage of more ram. While some numbers may seem insignificant if they scale it could pose a significant issue later. Of course this prompted further testing which is why this took 2 weeks to get done.


Testing High load

The next test was conducted with 8GB ram, why only 8? I wanted to run 3 identical virtual machines side by side, by using 8Gb I could do that and leave enough memory for my system to not impact results. I made two copies of the earlier virtual machine and opened each with a different browser.

I wanted to do this side by side to minimize outside influences and make it easier as doing all of it and restarting constantly was going to be an issue, so I decided to limit ram to 8gb, this allowed me to run 3 VM’s side by side. This means I could only do 3 browsers at once, so I picked Google, Brave and Firefox with adblock enabled.

Why this group, We wanted to see how Google Chrome acted, but I also wanted to see how Brave compared to it, and since I was more interested in best case scenario Firefox with adblocking seemed the more logical choice since we’re after lowest footprint. Firefox also seems quite predictable here as it seems the extra memory footprint was probably the size of the ad caching.

I started all three at the same time and clicked the same 7 links on Newegg, then on the Slashdot tab I pulled that out and went to Yahoo where I clicked the same links on each. Each link I opened was opened in a new tab, after 10 pages I opened a new instance and repeated this another 10 times, then once more. This gave 30 relatively high draw pages (full of trackers and ads) and wrote down the memory used.

After just 7 Newegg tabs there was noticeable difference in how things ran.
Brave -   1133Mb used  Scrolling was laggy
Google – 1410MB used Scrolling was a little laggy
Firefox – 1360MB all good

Separating the Slashdot tab into a new Window:
Brave -   No change
Google – 150MB increase
Firefox – No change

After 10 tabs in the new Window with Yahoo,
Brave -   1839MB Scrolling was VERY laggy
Google – 2901MB Scrolling was VERY laggy
Firefox – 2048MB all good

Again I broke off the last tab into a new window
Brave -   No change
Google – 150MB increase
Firefox – No change

Then opened another 10 tabs.
Brave -   2045  Scrolling was VERY laggy
Google – 3824  Scrolling was PAINFUL
Firefox – 2583  all good

I find it odd that Brave had scrolling issues  before the others, even though Google later surpassed it on this. Google was also the only one to show a noticeable amount of change by dragging a tab into a new window, this is probably the Google APIs. Google became almost unusable by the time it hit 3.5GB of ram, lagging like crazy any time I tried to scroll, and while it's possible Brave would have done better with more system ram I didn't get a chance to test that. I do know from experience Firefox reaches this point at around the 9-13GB mark in Linux.


Bonus CPU load
After the last test I decided to look at system CPU load, I wish I had looked at this sooner as it's interesting.
Brave -   5.2%
Google – 13.8%
Firefox – 6.1%

Don't jump to too many conclusions here, it's easy to blame Google's telemetry and apis but I suspect this has way more to do with advertisements and page tracking, something both Brave and Firefox were blocking. Regardless of reasons, laptop and power users should take note of this one as it directly links to battery life. I really think this needs more testing but I have little doubt at least half of that is due to the advertisements.


So what did we learn here?
We already knew Chrome likes ram, that's nothing new. What is new is seeing how it relates to other browsers, particularly Brave, in the end it was using almost double what Brave was using. If you want to stick to a Chromium based browser, maybe switch to Brave, or better yet, Firefox with an adblocker. Yes, it used a bit more resources, but still FAR lower than Chrome and it maintained it's composure throughout the entire test, something the other two failed at right away.

Windows users probably spotted that this used a lot less ram before it started having issues sooner than you are used to seeing, this has to do more with Windows overhead vs Linux overhead but shouldn't alter the results too much. In my experience the performance/results are the same, the only change is how much overhead you have. Lowering the overhead probably will not change how many pages and cached files you can view, it's only going to alter how much ram you use in the process. In other words, if the system craps out with 5000 files in memory, it will happened regardless if there's 4GB of overhead along with it or 1GB or overhead.  Switching to something with less overhead will not help with that, though it can help by leaving more memory for other programs.

Last thing,
I've said this before, memory/ram is not the end all/be all on how to rate software, you have ram, the system should use it when available. When free, you actually want everything to use as much as it needs to run at peak performance, just because something uses "low resources", that does you no good if it runs terrible as a result. If you have the resources, it should take advantage of them, that's the whole point of having them. This doesn't change that argument, yes, Chrome is using more ram, but it's not using it to benefit performance it's being squandered for telemetry and advertisements. None of this is directly benefiting you. Low resources are great when there are none to be found, but when you have them, you want it to use them.


This test wasn't perfect.
I didn't do multiple runs, I should have been watching cpu usage, I could have used Windows, I could have blah blah blah... This was never intended to even happen at all, I got curious and just started running tests. It is what it is.
Novelkeys NK65AE w/62g Zilents/39g springs
More
62g Zilents/lubed/Novelkeys 39g springs, HK Gaming Thick PBT caps, Netdot Gen10 magnetic cable, pic
| Filco MJ2 L.E. Vortex Case, Jailhouse Blues, heavily customized
More
Vortex case squared up/blasted finish removed/custom feet/paint/winkey blockoff plate, HID Liberator, stainless steel universal plate, 3d printed adapters, Type C, Netdot Gen10 magnetic cable, foam sound dampened, HK Gaming Thick PBT caps (o-ringed), Cherry Jailhouse Blues w/lubed/clipped Cherry light springs, 40g actuation
| GMMK TKL
More
w/ Kailh Purple Pros/lubed/Novelkeys 39g springs, HK Gaming Thick PBT caps, Netdot Gen10 Magnetic cable
| PF65 3d printed 65% w/LCD and hot swap
More
Box Jades, Interchangeable trim, mini lcd, QMK, underglow, HK Gaming Thick PBT caps, O-rings, Netdot Gen10 magnetic cable, in progress link
| Magicforce 68
More
MF68 pcb, Outemu Blues, in progress
| YMDK75 Jail Housed Gateron Blues
More
J-spacers, YMDK Thick PBT, O-rings, SIP sockets
| KBT Race S L.E.
More
Ergo Clears, custom WASD caps
| Das Pro
More
Costar model with browns
| GH60
More
Cherry Blacks, custom 3d printed case
| Logitech Illumininated | IBM Model M (x2)
Definitive Omron Guide. | 3d printed Keyboard FAQ/Discussion

Offline dingusxmcgee

  • Posts: 214
  • Location: West MI
Re: Browser memory and cpu loads
« Reply #1 on: Mon, 11 November 2019, 20:00:12 »
Was talking about that thread to a coworker the other day. This was a pretty interesting read. Will have to go back and re-read tomorrow

Offline tp4tissue

  • * Destiny Supporter
  • Posts: 13565
  • Location: Official Geekhack Public Defender..
  • OmniExpert of: Rice, Top-Ramen, Ergodox, n Females
Re: Browser memory and cpu loads
« Reply #2 on: Mon, 11 November 2019, 20:10:30 »
Good write-up

Chrome is alot faster for a bunch of stuff.  Still waiting for it to support color management though.

Firefox has way better color.

Offline Leslieann

  • * Elevated Elder
  • Thread Starter
  • Posts: 4519
Re: Browser memory and cpu loads
« Reply #3 on: Tue, 17 December 2019, 17:11:46 »
I tried to find this when I was writing this and was unable, but here it is now.

If you think CPU is important for browsers take a look here, note the bottom, 5% cpu and 95% memory.

Palemoon is a fork of Firefox, and while this is several years old (aug. 2014) it shows that even then the cpu was not the limiting factor. This was Win7 running on an Intel I7 2600k/16Gb ram.
It was dog slow by 9gigs ram, I pressed on until I hit the tab limit (250), by this point it was almost unresponsive.  When I upgraded to 32gigs years later it still ran slow at 9 gigs.

232013-0
« Last Edit: Tue, 17 December 2019, 17:18:11 by Leslieann »
Novelkeys NK65AE w/62g Zilents/39g springs
More
62g Zilents/lubed/Novelkeys 39g springs, HK Gaming Thick PBT caps, Netdot Gen10 magnetic cable, pic
| Filco MJ2 L.E. Vortex Case, Jailhouse Blues, heavily customized
More
Vortex case squared up/blasted finish removed/custom feet/paint/winkey blockoff plate, HID Liberator, stainless steel universal plate, 3d printed adapters, Type C, Netdot Gen10 magnetic cable, foam sound dampened, HK Gaming Thick PBT caps (o-ringed), Cherry Jailhouse Blues w/lubed/clipped Cherry light springs, 40g actuation
| GMMK TKL
More
w/ Kailh Purple Pros/lubed/Novelkeys 39g springs, HK Gaming Thick PBT caps, Netdot Gen10 Magnetic cable
| PF65 3d printed 65% w/LCD and hot swap
More
Box Jades, Interchangeable trim, mini lcd, QMK, underglow, HK Gaming Thick PBT caps, O-rings, Netdot Gen10 magnetic cable, in progress link
| Magicforce 68
More
MF68 pcb, Outemu Blues, in progress
| YMDK75 Jail Housed Gateron Blues
More
J-spacers, YMDK Thick PBT, O-rings, SIP sockets
| KBT Race S L.E.
More
Ergo Clears, custom WASD caps
| Das Pro
More
Costar model with browns
| GH60
More
Cherry Blacks, custom 3d printed case
| Logitech Illumininated | IBM Model M (x2)
Definitive Omron Guide. | 3d printed Keyboard FAQ/Discussion