6 Replies
      Latest reply: Nov 17, 2016 1:49 AM by eskimo RSS
      ferasOS Level 1 Level 1 (0 points)

        HI,

         

        I have an iOS app and we have a regular tracking network update whcih is using alot of power. We are looking for various ways of reducing this. Is it possible to power down netowrking hardware quicker? as in decrease the additional period of time they are turned on in anticipation of more work ?

         

        Thanks

         

        Feras A.

        • Re: Disable Network anticipation
          KMT Level 8 Level 8 (8,425 points)

               >decrease the additional period of time they are turned on in anticipation of more work

           

          Kind of a catch-22, isn't it?

           

          If you reduce network pre-loading pre-need, you prolong network fetch post-need. What you save on the front end you spend on the back. As well, I'm not confident your app is allowed to directly control the throttle - other apps may have their own needs and the system's job is to cater to the greater good, I think.

           

          What have you already done to reduce power usage by your app outright? Aer there any power usage metrics you can share from your testing?

           

          Ken

            • Re: Disable Network anticipation
              ferasOS Level 1 Level 1 (0 points)

              Hi,

               

              I ran the energy diagnotics in Xcode, whcih showed a high level of network usage. The average energy impact is high and we are trying to bring it down to low. Everytime we ping to gosquared we have a momentary surge in CPU energy cost but that immediately dissipates. The overhead cost on the otherhand averages above 40% and we are trying to decrease that.

               

              I have also run a timing profiler in instruments to look at how much time is utilised by different parts of the code in order to focus on them and make them more efficient, with the aim of decreasing the energy consumption.

               

              Is there any other usage metrics I can measure that you think would be beneficial?

               

              Best,

               

              Feras A.

            • Re: Disable Network anticipation
              eskimo Apple Staff Apple Staff (6,765 points)

              I have an iOS app and we have a regular tracking network update whcih is using alot of power.

              Please explain more about what you mean by “regular tracking network update”.  Does this apply occur only while your app is in the foreground?  Are you tracking changes in the local network environment?  Or at changes that occur on some server available on the wider Internet?

              Share and Enjoy

              Quinn “The Eskimo!”
              Apple Developer Relations, Developer Technical Support, Core OS/Hardware
              let myEmail = "eskimo" + "1" + "@apple.com"

                • Re: Disable Network anticipation
                  ferasOS Level 1 Level 1 (0 points)

                  HI,

                   

                  Basically we are pinging to gosquared every 20 seconds for real time analytics, even when the back is in the background.

                   

                  Best

                   

                  Feras

                    • Re: Disable Network anticipation
                      ferasOS Level 1 Level 1 (0 points)

                      when the app*

                      • Re: Disable Network anticipation
                        eskimo Apple Staff Apple Staff (6,765 points)

                        Basically we are pinging to gosquared every 20 seconds for real time analytics, even when the back is in the background.

                        Yeah, don’t do that, it’ll severely reduce battery life.  Even if you had direct control over the networking hardware, and could thus force it to power up and power down at will, which you don’t, pinging the network every 20 seconds would still severely reduce battery life.  Some network interface specs require that the hardware stay active for a certain minimum amount of time, and that time is of the order of tens of seconds, so pinging every 20 seconds is basically keeping that interface in a high power state continuously.

                        You need to change your approach.  I recommend that you do this work server side, and then use push notifications to tell the device that something noteworthy has occurred.

                        Share and Enjoy

                        Quinn “The Eskimo!”
                        Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                        let myEmail = "eskimo" + "1" + "@apple.com"