Complications called every second in simulator, even when value has not changed

I like the event driven thought with complications to save resources, so I use them as my preferred datasource.

In the simulator however, the listener is also called when the value has not changed. Is this also on the device, or is that simulator only?

  • You may find you don't want to always subscribe/register to a complication and not get called all the time for efficiency.

    Using steps as an example, you really only need the value when you are going to display it - in a watch face either every second or most times, every minute.  While you can still use the onPress logic to launch the complication, you can get the steps value from ActivityMonitor and only when you are going to display it, so more efficient.  In this case, you'll also find that through 9999 steps, if you subscribe/register, you get a number, but with 10000 or above, you get a float (say 10.1K) as that's how native stuff displays steps,

    In my own apps, I only tend to subscribe/register to CIQ published complications, like my own for weather, where by default I only publish/update every 15 minutes so I don't get hit with updates that often.

  • I have seperated data retrieval from graphics. Graphics update every second if allowed. Data prepares all the values graphics needs and only is invoked if it is changed. So if I'd put steps in Graphics instead of Data, it would be requested every time updateView is called, that would be once a second or minute depending on the mode and also if the data has not been changed, I would need a check to see if it is changed and recalculate the data for graphics.

    Complications imo are maximum called once a second and in allways on power saving mode only once a minute, only if a value is changed, so if the complication triggers I recalculate the graphics values. This should be more efficient. I guess in the simulator all complications update every second to have the maximum impact for performance testing.

    Thanks for the tip on the steps formatting, I also noticed intensivity minutes are calculated for the day, not for the week. I now have set to fetch the value from ActivityMonitor when the complication gets triggered. Recovery time is opposite, in ActivityMonitor only for the last activity and in the complication for the total.

    This seems to work great. I'll prob make some counters that I can show in my beta wf to check my theory.