ConnectIQ app running very slow on Edge520Plus, SDK3.1

I am running a simple watch face app on Edge520Plus, but it is running extremely slowly.  For example if I press button to change screen it can take 2-5 seconds to react.  SDK is 3.1.

On simulator it is fine, no problems at all, and previously run on Edge520 with SDK 2.4 again no problems.

App is reasing data over Ant at 8Hz from our proprietary device, displaying on screen and writing to FIT file.  Nothing particularly computationally intensive.

Any ideas what could be causing this?

  • When a button is pressed, are you calling Ui.requestUpdate()?

    Something like:

        function onNextPage() {
        	view.currentIdx++;
        	if(view.currentIdx>=view.scanResults.size()) {view.currentIdx=0;}
        	Ui.requestUpdate();
        	return true;
        }

  • If you are too processor intensive, the watchdog timer should trip.

    One case you won't is if you have a timer that's firing too fast.  If you have a timer firing every 50 ms, you'll likely run into issues.

  • Hello

    I am updating the UI on every receive event on the ANT channel, which is running at 8Hz.  If I slow this down to 4Hz then everything is ok. 

    Screen becomes very slow to update, and even button to start recording fit file (via FitContributor) takes several seconds to start the log (make sound) or doesn't even do it at all.

    If there are any other tests I can run please let me know.  4Hz is perfectly adequate, but seems like I shouldn't be having this sort of issue.

  • So you're updating the display at 8hz?

    What if you update the display using a timer, say 2hz?

  • Thats exactly what I did in the end, but at 4Hz.  Which is fine, but just a bit irritating as I don't know what exactly is causing the slowdown. From what you say above, I shouldn't be seeing any issues?  8Hz isn't all that quick.

  • It is quick when it comes to updating the display.  The updating display is probably the slowest part of an app, as each time onUpdate() gets called, the entire display is updated.  Not only can this impact things that you see, it will also impact the battery life.

    I've been experimenting with one of my apps that updates the display at 1hz, and by slowing it to .5hz, I get a significant battery savings.

    With watch faces, there's onPartialUpdate(), which is called every second, but it's really restricted in that it can only run for an avg of 30ms each second, where you use clip regions to only update a section of the display (commonly just the seconds), and that's due to trying to save battery as much as anything.

    I'd probably look at slowing the display update to 2hz or 1hz for the battery alone.