Fenix: FNX-3525 ⁃ [Bug] Battery regression after migrating from fennec

Created on 4 May 2020  ·  13Comments  ·  Source: mozilla-mobile/fenix

A user reported an issue from Riot:

Firefox Beta is absolutely destroying my battery life on my Pixel since the upgrade from Fennec took place.

See a few issues mentioned in the closed https://github.com/mozilla-mobile/fenix/issues?q=is%3Aissue+battery+is%3Aclosed, nothing in the open issues. Not sure what our tooling for tracking such problems?

We have a speedometer test suite that monitors battery usage but afaik, it actually performs better than fennec

For this issue, we should determine:

  • Is our battery testing sufficient? If not, what's our plan?
  • How can we diagnose and address this issue?
performance 🐞 bug

Most helpful comment

To clarify our intent by closing this issue, we don't have enough information here to reproduce the issue so the issue as it is is unactionable and we're closing it to bring clarity to our project board: we are not doubting that the issue exists. If you have reason to believe you have additional information about battery issues that isn't present here and that would help us reproduce the issue, feel free to open a new issue. That being said, in the future, we intend to develop better battery testing methodologies and at the very least address battery issues such as this then.

All 13 comments

My regular app usage consists of:

  • the github notifications page, visiting issues and pull requests, leaving comments
  • reading email in the MoCo gmail
  • looking at the logged in instagram homepage

Doing these three activities over the course of 20 minutes caused the android battery status system app to report that 20% of my battery was consumed by Fenix during that time. This was a Pixel 1 phone with latest Android updates.

@jdm Are you signed into FxA? Do you have any WebExtensions installed?


Triage: this is a very high priority but it may be difficult to reproduce so we should try to timebox our investigations to a day or two and re-evaluate rather than falling into a rabbit hole. :)

We should:

  • Test out a few hypotheses (FxA, WebExt, etc.)
  • Try to use older devices – devices with less battery capacity and a more aged battery – to make this easier to notice
  • @ gmierz (:sparky) has some experience on battery debugging: we should connect for tips and tools
  • Keep in mind for the user it appears to be visible in ~20 minutes

Note: ecsmyth was unable to reproduce but he was on higher-end hardware and was not signed into FxA. He hasn't seen any stand-out reviews on the Play Store mentioning this behavior either.

No extensions. I am signed in to FxA.

I spent the weekend barely touching my phone and without the Firefox app running. It still had the highest percentage of battery usage charged to it (37% over the course of most of a day with 2 minutes of usage time reported), which makes me suspect that there's a background process of some kind at fault.

@jdm That's odd... I'm running it on a G5 and I'm seeing barely any battery consumption ( only around 1.68% using FxA , github, instagram and gmail). Would it be possible for you to give the battery report from the phone with these commands:

adb shell dumpsys batterystats > batterystats.txt and adb bugreport > bugreport.zip

Even if I don't feel much in my daily usage, Android send me notifications about Fenix having a huge battery consumption from time to time even without doing expensive things like playing video or doing download.
I am signed in to FxA and have uBlock and Dark Reader enabled.

If i ever get it again, i will try to have my computer around to do the batterystats and bugreport

@jdm this would be a bit of a pain so I understand if it might be asking too much. Splitting out the websites you list to 3 different apks of the Fenix project could let us know if one of the websites are a problem. <org.mozilla.fenix.nightly> <org.mozilla.firefox_aurora> <org.mozilla.fenix> <org.mozilla.firefox_beta> and could get you access to

My suspect would be Instagram or something else creating a media notification that keeps Firefox playing some media.

I was measuring using a G5 plus and currently have been on Instagram, github, and gmail for 1h+ on Nightly, Fenix Preview release ( from the play store) and chrome. They all share the same % of usage (+/- 1%). I'm wondering if this might be related to migrated users (I'm using a brand new account).

As an additional data point, I also started noticing weirdly high battery usage attributed to the "Firefox Preview" app on my Pixel 3 within the past few days. I think it also updated to 5.0.0 within the past few days, so that may be related.

For what it's worth, it seems to persist even after I clear all user data the app and then basically just do the initial config and then stop touching the app for a few hours.

So as of right now, I've noticed that Fenix takes more power on higher phones ( phone used was Essential Phone - Snapdragon 835 with Android 10). I have pasted some of the images from the profile in here, but the full profiles are zipped too. I can say that from the report, Fenix seems to be ~0.45% of total power useage on the G5 and ~1.6% on the essential phone.

The test was done with the same as reported initially: screen brightness turned on to the max with the three websites open: 1) Github (logged in) 2) Instagram (logged in) and 3) Gmail (logged in) and logged into FxA.

The G5 discharge rate was ~5-8% for 2 hours on with Fenix in the foreground.
This graph is the battery level over ~1h45min the starting point is 59 and end level is 43 min:
image

This one is of chrome over ~1h30 from 59 to 48:
image

On the other hand the the Essential phone seemed to have a worst numbers for energy consumption with discharge rate between 15% up to 23%.

The graph was taken over ~1h50 and went from 82 to 42%
image

I'm not sure what to draw as a conclusion. From the power statistics, the biggest difference between the G5 and essential phone was the screen power useage (I think ~10%).

phones_battery_report.zip

I'm experiencing the same regression on an Android 9 device.

However, turning on WebRender (by setting gfx.webrender.all to true in about:config) significantly reduces the battery consumption, lowers the temperature of the device, and increases performance while using Fenix, compared to default settings.

Fenix's battery usage with WebRender enabled is tolerable for a default browser. Without WebRender, it is unreasonably high on my device.

After trying to find the root cause of this issue, it seems as if this is a wild goose chase. I've noticed that , on the pixel 4 Fenix will show up as "high" usage (around 20%) when looking in battery breakdown. However, that only shows the % of CPU used per app that affected the power. You can expand the menu to show how the system also affected the battery. When I did that, Fenix goes down to ~1.5% which matches battery historian and the screen takes most of that.

To clarify our intent by closing this issue, we don't have enough information here to reproduce the issue so the issue as it is is unactionable and we're closing it to bring clarity to our project board: we are not doubting that the issue exists. If you have reason to believe you have additional information about battery issues that isn't present here and that would help us reproduce the issue, feel free to open a new issue. That being said, in the future, we intend to develop better battery testing methodologies and at the very least address battery issues such as this then.

Was this page helpful?
0 / 5 - 0 ratings