Firefox consumes more CPU than Chrome(?)

RESOLVED INCOMPLETE

Status

()

RESOLVED INCOMPLETE
4 years ago
3 years ago

People

(Reporter: jujjyl, Unassigned)

Tracking

33 Branch
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [Power])

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
Created attachment 8473158 [details]
firefox_prefmon.png

I just read this new article from AnandTech which compares battery life when browsing with Firefox vs when browsing with Chrome:

http://anandtech.com/show/8327/browser-faceoff-battery-life-explored-2014

Their result is that they are able to browse the web 100 minutes longer with Chrome. However they might have botched that up a bit with the HiDPI handling and the test is not completely apples to apples.

Reading the article reminded me of an old perfmon test I had a long time ago on my Macbook Air running Firefox vs Chrome on Windows in bootcamp. I had noticed that the fan of the laptop is more prone to spin up when browsing Firefox vs when browsing with Chrome. Also looking at the task manager, the firefox process steadily consumes 10% of the CPU even when idle. I see this being reported also in bug #892034.

These items suggest that Firefox might be more heavy on the CPU than Chrome is. Does Firefox run battery life tests as part of a release cycle?

Comment 1

4 years ago
Note that the issue might be GPU consumption, not necessarily CPU.

For CPU, we used to run powertop on mobile firefox when I was there, and our results back then were pretty good after we removed a bunch of unnecessary timers, and that translated to desktop as well. This was several years back though.
(In reply to Jukka Jylänki from comment #0)
> Created attachment 8473158 [details]
> firefox_prefmon.png
> 
> I just read this new article from AnandTech which compares battery life when
> browsing with Firefox vs when browsing with Chrome:
> 
> http://anandtech.com/show/8327/browser-faceoff-battery-life-explored-2014
> 
> Their result is that they are able to browse the web 100 minutes longer with
> Chrome. However they might have botched that up a bit with the HiDPI
> handling and the test is not completely apples to apples.
> 
> Reading the article reminded me of an old perfmon test I had a long time ago
> on my Macbook Air running Firefox vs Chrome on Windows in bootcamp. I had
> noticed that the fan of the laptop is more prone to spin up when browsing
> Firefox vs when browsing with Chrome. Also looking at the task manager, the
> firefox process steadily consumes 10% of the CPU even when idle. I see this
> being reported also in bug #892034.

We had a look at idle power consumption on desktop earlier this year and after few adjustments the conclusion is that FF is comparable with the other major browsers (see Bug 948528). That being said, if you are idling on a website there are all kinds of things that could go wrong (see Bug 962573), like hidden animated gifs that continue to be rendered.

> These items suggest that Firefox might be more heavy on the CPU than Chrome
> is. Does Firefox run battery life tests as part of a release cycle?

Joel is working on deploying our power test suite "energia" (https://github.com/vitillo/energia.git). But you can already have a look at some data collected earlier this year: http://people.mozilla.org/~rvitillo/dashboard/.
(Reporter)

Comment 3

4 years ago
Very nice data!

For added reference, I tried the Intel Power Gadget on my Macbook Air, and compared the consumption between having all programs closed and having just Firefox Nightly open with no tabs open and the 9-grid of MRU pages visible, and having only Chrome open:

Idle, all programs closed:

Package Pwr0: 2.90W
Package Frq0: 0.80GHz
GT Frq0: 0.35GHz
Package Temp0: 54C

Idle with Nightly 34 Open:

Package Pwr0: 3.30W
Package Frq0: 0.80GHz
GT Frq0: 0.35GHz
Package Temp0: 60C

Idle with Chrome 36 Open:

Package Pwr0: 3.11W
Package Frq0: 0.80GHz
GT Frq0: 0.35GHz
Package Temp0: 56C

I repeated these two times and the numbers seem very consistent. The difference is not big though.
(In reply to Jukka Jylänki from comment #3)
> Very nice data!
> 
> For added reference, I tried the Intel Power Gadget on my Macbook Air, and
> compared the consumption between having all programs closed and having just
> Firefox Nightly open with no tabs open and the 9-grid of MRU pages visible,
> and having only Chrome open:
> 
> Idle, all programs closed:
> 
> Package Pwr0: 2.90W
> Package Frq0: 0.80GHz
> GT Frq0: 0.35GHz
> Package Temp0: 54C
> 
> Idle with Nightly 34 Open:
> 
> Package Pwr0: 3.30W
> Package Frq0: 0.80GHz
> GT Frq0: 0.35GHz
> Package Temp0: 60C
> 
> Idle with Chrome 36 Open:
> 
> Package Pwr0: 3.11W
> Package Frq0: 0.80GHz
> GT Frq0: 0.35GHz
> Package Temp0: 56C
> 
> I repeated these two times and the numbers seem very consistent. The
> difference is not big though.

Yukka, how does the power consumption look like on your machine if you use about:blank instead of the 9-grid? Do you have a Haswell CPU?
(Reporter)

Comment 5

4 years ago
With about:blank it's the same. This is a Sandy Bridge CPU.
I am not able to reproduce what you are seeing with a similar configuration. Does using a fresh profile change something? For how long did you run power gadget? Did you terminate all background services, e.g. spotlight, dropbox, etc.?
(Reporter)

Comment 7

4 years ago
Switching to a new profile does not change the reading. I had the power gadget on continuously on the background, and took the reading after keeping the browser open and idle for about a minute. I closed down all user applications, but did not touch any Windows services, since killing those is not generally considered safe and might make the system unstable.
Flags: needinfo?(vdjeric)
Would logging disk+cpu+network+paging activity on Jukka's machine with SAR help shed some light on this? 
e.g. http://superuser.com/questions/581108/how-can-i-track-and-log-cpu-and-memory-usage-on-a-mac

Roberto, do you want me to try reproducing this on my Windows machine?
Flags: needinfo?(vdjeric) → needinfo?(rvitillo)
Vladan, it would be great if you could get some numbers on your machine.
Flags: needinfo?(rvitillo)
Whiteboard: [Power]
I'm going to close this because the description is so broad that it's unlikely to lead anywhere. Please feel free to open new bugs for more specific issues.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.