Benchmarking Datafield onUpdate(dc) and anticipating variation (for example due to Varia Radar)

I am working on a fullscreen datafield (for an Edge device) and doing some benchmarking to try get an idea of how much load I'm putting on the system.  As expected, most of the CPU load is in onUpdate(dc).  I am trying to figure out what would be a safe maximum execution time (on my Edge 830) for it to still work smoothly on older/slower Edge devices.  Initially I thought something like 100ms would be safe having seen that onUpdate(dc) is typically only called once a second, however after connecting a Varia Radar I noticed onUpdate(dc) is now called much more often - around 4 times a second!  This discovery concerns me - what other peripherals/factors could impact the update rate? Is there a maximum? 

Does Garmin provide any recommendations on CPU usage, or direction on estimating or limiting the impact of an app on battery life?

  • Couple things - When a data screen is updated, the screen is cleared, and the sperator lines are drawn (if needed), and then each DF is updated.  What is probably happening with Varia, is it's updating the screen every 250ms, which means the whole screen is updated that often.  You might see a similar thing if the DF is on a map, where the map (and therefore the screen) is getting redrawn more often.

    You want to do the very minimal in onUpdate (like only update the display and do little more), as for one thing you can have multiple DFs on the same screen, so no sense re-doing things you don't need to.  So do the calculations you can in compute() and not in onUpdate()