Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞 [iOS] High battery usage created by overhead #179

Open
JustinGanzer opened this issue Nov 14, 2019 · 5 comments
Open

🐞 [iOS] High battery usage created by overhead #179

JustinGanzer opened this issue Nov 14, 2019 · 5 comments
Labels

Comments

@JustinGanzer
Copy link

Configuration

  • SDK Version [5.5]
  • OS Version: [13.2.2]
  • Device: [iPhone 6S Plus, iPhone X]

Steps to Reproduce

  • integrate Mapbox - display a MGLMapView (optional?)
  • simulate the user slowly driving across the city
  • no map updates, nothing else => app is completely idle but updating location data
  • leave the MGLMapboxMetricsEnabled Userdefault at true/default

Expected
I expected the SDK to be preservative of battery life by means of batch send telemetry and such, thus leaving radios to go idle every once in a while.

What Actually happens
Radios never ever go to idle, responsible for over 60% of the average component utilization.

Other findings
By only doing one thing, that is opting out of Mapbox telemetry (through the app settings of iPhone) almost immediately drops the overhead completely.

Logging

With telemetry enabled

Screenshot 2019-11-14 at 11 41 51

With telemetry disabled

Screenshot 2019-11-14 at 11 46 07

I'll update as soon as I have time to further investigate, but perhaps anyone can confirm this behaviour? That is a lot of energy consumed by telemetry if that is the case. Hopefully we can find a way to leave telemetry on all while lowering power consumption.

@alfwatt
Copy link
Contributor

alfwatt commented Nov 14, 2019

@JustinGanzer thanks for the bug report, the periodic network activity spikes look like our telemetry system sending batches of data but we don't expect the extra overhead that you're seeing.

simulate the user slowly driving across the city

How did you simulate this? Using the built-in simulation tracks or a gpx file?

@JustinGanzer
Copy link
Author

Hey @alfwatt, I'm currently testing using real devices as well as gpx files recorded using an iPhone, for the simulator doesn't support battery analysis as fas as I am aware.

Now that I think about the simulation environment, our app is connected via Wifi. I'm not sure if there is a difference in time the radios stay on when compared to cellular data.

If you find any of these factors could potentially yield different results, I'd be willing to go out and test it in a more natural environment.

@allanweir
Copy link

I'm seeing the same percentage of usage when using Mapbox and a cellular connection. Every 30 seconds the SDK is requesting a location and posting back to mapbox.com.

@ghost
Copy link

ghost commented Jan 10, 2020

Same issue here. Are you planning to fix this?
If you want to easily test, just create a new project with a blank view controller and Mapbox SDK integrated. It is not necessary to add a map view.
You will get a high battery usage.

@jerilyngigigo
Copy link

Same issue happening with our app, overhead is constantly on 60%.

@alfwatt alfwatt removed their assignment Feb 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants