Safe value of energy impact in iOS
Asked Answered
W

1

6

I have created an iOS app and it's first phase is almost complete. Basic flow of app is that a user can add his offer. Other users can avail this offer by booking it. The number of offers keeps on increasing/updating therefore all the data in app is loaded from server. Now in the debug navigator, all values are more or less within safe area (green area) as shown:

enter image description here

But the energy impact is:

enter image description here This is the at the time when app is requesting server to load items in list. Now my questions are:

  1. What energy impact exactly is? (searched but couldn't find anything to have proper understanding)
  2. What are possible reasons of its high value?
  3. What is it's safe value? Do I need to try to make it low?
  4. If yes, then what possible approach I can try to make it low?

Moreover, even if the user is not interacting with the app the energy impact is (not exactly zero):

enter image description here

Whereas according to apple docs:

When the user isn’t interacting with your app, there should be no energy impact.

Any help would be appreciated, as I am a newbie to iOS.

Wastrel answered 26/3, 2018 at 6:56 Comment(0)
P
2

Check to see how often you are pinging on the processor. Most energy savings come from the processor dropping into the better power conservation states (called C-states). If you are checking too often, the processor stays awake and you consume a lot more power.

Good rule of thumb is to do the least pinging/checking as possible without significantly impacting performance.

Let's look at your average component utilization. 'Overhead' usually refers to an excessive amount of context switching. One possible solution is to buffer data more to decrease any network calls. Another possibility is excess memory usage causing a lot of page swapping. This usually only happens if you are topping out your real memory/RAM usage.

'CPU utilization' looks high, particularly since you are not doing a lot of computation. Look at my comment on minimizing any pinging/checking.

Proclivity answered 29/3, 2018 at 16:35 Comment(1)
Thankyou for such detailed answer. As you have mentioned pinging, my app pings the server every 25 seconds, to keep the socket connection alive. I changed 25 to 35 but their was no effect on energy impact. If I increase it more the connection will become dead and notifications will be missed. (My app works on instantaneous notifications, like on demand apps does) Can you provide me with some solution by considering this socket scenario?Wastrel

© 2022 - 2024 — McMap. All rights reserved.