Firefox uses a lot of CPU on MacOS
Categories
(Core :: General, defect)
Tracking
()
Performance Impact | low |
People
(Reporter: domoritz, Unassigned)
References
(Depends on 1 open bug)
Details
(Keywords: perf:resource-use, power)
Attachments
(3 files)
Updated•7 years ago
|
Reporter | ||
Comment 1•7 years ago
|
||
Updated•7 years ago
|
Updated•5 years ago
|
Firefox use about 8 time more CPU than Safari on MacOS. Especially when scrolling page (without scaled resolution). Their was great improvement already with https://mozillagfx.wordpress.com/2019/10/22/dramatically-reduced-power-usage-in-firefox-70-on-macos-with-core-animation/ but the current situation is not good enough.
High CPU usage is not cool as it push people to buy new computer :/.
Comment 3•4 years ago
|
||
I can confirm that scrolling up and down this thread several times in Firefox and Safari CPU peaks at around 35% and 10% respectively. Resizing the each browser window the numbers are similar. Should this be moved into a separate ticket?
Comment 4•4 years ago
|
||
Has anyone checked that other processes don't make up the difference between "Firefox" and "Safari"? Both applications use lots of processes. And, as mentioned above, the cpu usage of the "Window Server" process (at least) can increase in proportion to the cpu usage of its "clients".
Someone should try measuring the "Firefox group of processes" against the "Safari group of processes", including a best guess at what share of "Window Server" cpu usage is due to each. And why not also throw in the "Chrome group of processes"?
Edit: I can see that at least some people are already measuring process groups (using the hierarchical process viewer in Activity Monitor). Still, though, one wants to make sure people are comparing apples to apples.
And Safari. Using the same page (this bug page) and scrolling back and forth at normal speed.
On this naive test it's so it's not that bad. But still.
Comment 7•4 years ago
|
||
Perdrisat: What hardware are you testing on, running which version of macOS? I assume that, in each case (Firefox and Safari), only one tab (this bug's page) was open in the browser. Is that correct?
Comment 8•4 years ago
|
||
I just tested on a new Mac Pro (7.1, 48GB of RAM, 3.2 GHz 16-Core Intel Xeon W) running macOS 10.15.7. The CPU usage results for Firefox 85.0.2 (the current version) and Safari were basically identical. Each browser had only one tab open (this bug's page), at your comment 6. I made both pages identical in size, and ran Firefox and Safari one at a time (they weren't both running at the same time). I didn't have any other instances open of either browser. I didn't have any third party extensions running in either browser. I moved the mouse around as fast as I could manage, and scrolled the page up and down a bit (but not so far that some part of comment 6 wasn't visible).
Admittedly my machine is extremely powerful, and very atypical. But I now suspect this problem may be worse on less powerful machines, or perhaps on different versions of macOS. It's also possible one or more third party extensions may be involved.
Only once we have good STR can we begin to understand this problem.
Edit: We should also consider the possibility that the extent of this problem differs with the graphics hardware you're using. I have an AMD Radeon Pro 580X with 8MB of VRAM.
Comment 9•4 years ago
|
||
I just performed the same test on another machine: A mid-2015 15 inch Retina MacBook Pro (11,5 16GB of RAM) with two different kinds of graphics hardware (an "integrated" Intel Iris Pro and a "discrete" AMD Radeon R9 M370X), also running macOS 10.15.7.
Here Firefox's CPU usage was notably worse than Safari's, but only about 1.5 times worse. This machine is less powerful, and now more than five years old. It's also a Retina machine, so I wonder if that makes a difference. (My Mac Pro doesn't have a Retina display.)
I used gfxCardStatus to force usage of either the "integrated" or the "discrete" video hardware. As you'd expect, the "discrete" video hardware used more CPU. But as best I could tell, it made no difference to the performance gap between Firefox and Safari.
One thing I noticed is that Firefox uses about as much CPU in the foreground as in the background. But putting Safari in the background makes it use dramatically less CPU. This might make Firefox use considerably more battery power over time.
Comment 10•4 years ago
|
||
It's also a Retina machine, so I wonder if that makes a difference.
As best I can tell, the Retina display doesn't make much difference. I tested by connecting my non-Retina display to my MacBook Pro (as an external display) and testing either on the external display or the built-in display. Each browser performed about the same on both displays.
Comment 11•4 years ago
|
||
My Mac Pro has 16 cores, but my MacBook Pro only 4. I wonder if that could make a significant difference.
Comment 12•4 years ago
|
||
I retested on my new Mac Pro. Now I'm seeing the same results as on my old MacBook Pro -- Firefox's CPU usage is about 1.5 times worse than Safari's. I also tested on a new M1 Mac Mini with 16GB of RAM and 8 cores, and got the same result.
So my results are pretty much the same everywhere, regardless of age, RAM size, number of cores, and even type of CPU. Clearly something is going on here, but I'm still no closer to figuring out what it is :-(
More extreme differences are probably caused by some other factor -- an external one like an extension, or a non-external one like some special case of the test performed.
One thing I noticed is that Firefox uses about as much CPU in the foreground as in the background. But putting Safari in the background makes it use dramatically less CPU. This might make Firefox use considerably more battery power over time.
This is the only other real discovery I've managed to make to this point.
Comment 13•4 years ago
|
||
One more thing: I just tested on a VMware VM running macOS 10.15.7, which doesn't have any support for graphics hardware acceleration. Once again Firefox's CPU usage was about 1.5 times that of Safari. I think this shows that the problem, whatever it is, has nothing to do with graphics hardware acceleration.
Comment 14•4 years ago
|
||
(In reply to Steven Michaud [:smichaud] (Retired) from comment #7)
Perdrisat: What hardware are you testing on, running which version of macOS? I assume that, in each case (Firefox and Safari), only one tab (this bug's page) was open in the browser. Is that correct?
My machine:
MacBook Air (13-inch, Early 2015)
1.6 GHz Dual-Core Intel Core i5
8 GB 1600 MHz DDR3
I did not do the test very properly, both browser had 3-4 tabs opens during the test (certainly in idle). But both browsers was using very limited CPU without scrolling. I will redo those when I got the chance and without adons too (I doubt it's the problem, I just have ublock).
Comment 15•3 years ago
|
||
Running into the same bug on a Mac Mini 2018 after rebuilding Firefox installation.
With 4 reporters, this should be confirmed.
Comment 16•3 years ago
|
||
Similar bugs go back to Firefox 3.6, but I can't test older builds due to incompatibilities with some of the sites.
I already reduced the Content Process Limit to 4, but it still jumps to 80% or even 120% usage for Firefox and another 80% for webextensions as soon as I start Firefox.
I don't encounter this in Troubleshoot mode, but a lot of standard web design practices trigger my migraines, and could trigger seizures, so I can't use the web without user css and add-ons.
Checking about:performance, it does look like an extension issue. Both Default Scroll and Allow Right-Click can cause energy usage to spike, but not having them allows sites to screw with users. A native Firefox fix might avoid some of this trouble.
Hi, could you capture a performance profile as mentioned here and post it here? https://firefox-source-docs.mozilla.org/performance/reporting_a_performance_problem.html
It would help us a lot to identify the problem.
Updated•3 years ago
|
Hi MarjaE, Adding a ni to you as well. It would be great if you could help with capturing a profile too.
Comment 20•3 years ago
|
||
(In reply to Nazım Can Altınova [:canova][:canaltinova on phabricator] from comment #18)
Hi, could you capture a performance profile as mentioned here and post it here? https://firefox-source-docs.mozilla.org/performance/reporting_a_performance_problem.html
It would help us a lot to identify the problem.
Hi there.
OP here. I'm not using macOS anymore. Tbh, I didn't think a resolution would take that long.
I don't think I could be of much help, sadly.
Comment 22•2 years ago
|
||
Redirect a needinfo that is pending on an inactive user to the triage owner.
:overholt, since the bug has recent activity, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 23•2 years ago
|
||
Hey Florian, do you think we can still investigate something from the STRs in this bug?
Updated•2 years ago
|
Comment 24•2 years ago
|
||
(In reply to Julien Wajsberg [:julienw] from comment #23)
Hey Florian, do you think we can still investigate something from the STRs in this bug?
Without a profile to look at, I doubt we can make this actionable. There was an interesting point in comment 9 about Firefox's CPU use being almost the same in the foreground or in the background. That might already be covered by eg. bug 1578123.
Comment 25•2 years ago
|
||
Yeah, I thought that you may want to look at this on your computer :-)
Updated•2 years ago
|
Description
•