Starscream icon indicating copy to clipboard operation
Starscream copied to clipboard

Socket overhead producing too much power consumption.

Open papley opened this issue 7 years ago • 5 comments

Any thoughts how we can keep an open socket and reduce power consumption?

First image shows socket ping every 3 seconds or so. No significant socket traffic. image Second image shows power consumption of app with socket open. image Third image shows power consumption of app with socket disabled. image

papley avatar Aug 29 '18 19:08 papley

As far as I can tell the vast majority of my application power consumption is a result of just having a socket open with no traffic except pings inherent to the socket implementation.

We're using Starscream 3.0.5 on iOS. XCode 10 Beta 6

papley avatar Aug 29 '18 19:08 papley

I have been using this library for some time now and I now believe that Xcode is very aggressive with its "energy impact" figures. I have noticed no significant battery drain when keeping the socket open for extended periods of time in practice. I believe apple is giving you this "data" mainly as a hint to make sure you are not doing any unnecessary processing over extended periods of time. I would take it as hyperbole, verify you aren't doing anything silly, and be on your merry way.

But I mean, that's just my 2¢ on this and I am sure there are much more informed people.

flagoworld avatar Apr 18 '19 17:04 flagoworld

Starscream 3.1.0 and I am seeing a lot of power consumption as well. Not just me, but i have a number of users complaining about the chat portion of my company's app because of how quickly their battery dies when in chat. This is mostly on SE and older phones (iOS 10 - iOS 13).

mmdock avatar Nov 08 '19 20:11 mmdock

Having the same issue here, the energy impact is always Height even without doing anything.

siempay avatar Apr 21 '21 14:04 siempay

Same here :-/

jerometonnelier avatar Oct 08 '21 09:10 jerometonnelier