Slow load and unload of watchface...

Hi,

I've been testing all kinds of things with Background, and apart from the known issues with Fenix6 basically failing on everything (6 calls succeeded out of 800 scheduled!) it's going pretty well.

 But...

On my 735xt, when I either enter or leave the watch face, eg: if I down button to view a widget or select button to enter an activity, there is a noticeable lag of ... um ... sometimes as much as ten seconds!

Well...

Clearly it's something I'm doing, and there are plenty of candidates out there, but nothing leaps to mind as especially noisome. The only thing I am definitely doing that I think is a contender is using a lot more Storage than I do normally as I am storing various logging numbers. But... Frankly... I'm not using that many storage values.

What is the most likely candidate for me to start digging through?

1. Is Toybox.Application.Storage likely to slow things down?

2. Is Application.getProperties() / setProperties() likely to slow things down?

3. Is initialisation and clean-up of background likely to slow things down?

4. Is it the type of storage I am using? (As a shortcut during testing, I've been storing data as I receive it from a JSON service rather than individual keys... it occurs to me that building the dictionaries / writing the dictionaries to storage might be slow.)

Anything else?

Thanks,

  • First thing to do is try other watch faces and see if they act the same.  If so, could be a FW issue.

    Any time you hit the file system, there is a cost.  As far as Application.Storage, the fewer keys the better - less times it's got to hit the file system.

    I'd look at what you do when your app starts.  If you are doing a boat load of drawing (say graphs), there could be a slight delay. 10 seconds is way out of the ballpark if you ask me

    I doubt it's the background, as that will run at most every 5 minutes, so moving the the widget loop and back really would have no impact.  But if you want to verify, have your background do nothing more than Background.exit(null) in onTemporalEvent