Launcher too slow

Posted on
  • Edit: Sorry, it's the launcher that takes 2.3 seconds, not the reading of the file. Ignore this post! I'll try and optimize the launcher then.

    sooo I was thinking...
    If I want to go to settings or launch an app (which happens a lot) I always get a loading screen (twice!) and have to wait a while. (once for the launcher, once for the settings)

    I know, it is probably due to memory efficiency, but I don't think the launcher is big enough to justify an extra app (at least at bangle2)
    I didn't have a look at Bangle.showLauncher yet, but if we reset() and put the launcher functions right there without loading an extra file, this would speed up everything massively. (at least in my imagination)

    I know this is wrong, so I think I would just do a little hack for the non-public version of my watch:
    I'll compress the launcher.app.js a bit further (variable names etc) to get it to ~1KB and put it in a function that stops my timeouts and executes the launcher.... and also overwrites backbutton functionality to start my timeouts again.
    This would cut all my waiting time in half. :)

    Gordon said something that I didn't understand though:
    In my case it's 0.25s for widgets alone. I just tried and having the internal flash enabled drops that to 0.06s
    https://github.com/espruino/BangleApps/p­ull/1611#issuecomment-1078085876
    How could I "enable internal flash"? I'm not sure what that means. :D

    Any thoughts / opinions / help are welcome

    PS: I also tested the eval(require('Storage').read("launch.app­.js")) suggestion, but the loading time is still ~2.3 seconds.

  • I measured the times of the launch.app.js parts:

    head....:    5
    settings:  204
    font....:    2
    apps....: 1168
    draw....:    2
    clear...:   27
    widgets.:  895
    scroller:  145
    rest....:    9
    
    TOTAL:    2439
    

    I know this totally depends on you number of apps and widgets, but if we could make widgets optional(maybe a setting?) and load the applist at boot, the menu would load in 376ms instead of 2439ms...

  • Did you try just running a Compact Storage from the Utils section of the Settings app?

    2.3 seconds is not normal, and I imagine the delay is because your filesystem is fragmented. The plan is to add something to sort this out automatically very soon.

    How could I "enable internal flash"? I'm not sure what that means. :D

    It requires a custom build of the watch firmware. Probably not something you want to try just yet :)

    and put it in a function that stops my timeouts and executes the launcher....

    The issue here is you've got to try and stop everything - like touch/swipe/accelerometer/gesture/GPS/ba­rometer/etc events - and many more. But yes, in your own personal branch you could actually overwrite Bangle.showLauncher with your own function that does that.

    There's nothing specifically in load that makes it slow. Maybe don't do this yourself as you'll have to overwrite the bootloader, but:

    >require("Storage").write(".boot0","prin­t(getTime())")
    >print(getTime());load()
    512.08120727539
    512.13412475585
    

    So the actual process of loading something takes only 0.05 sec.

    It's just what's in .boot0 (the bootloader) and your app that actually slows things down.

  • Did you try just running a Compact Storage from the Utils section of the Settings app?

    I'll go and sit in a corner for not trying that first after you already suggested that in the Pull request.. It's now "insanely fast" again...
    Thank you so much. This solves my waiting problems!

  • How fast is "insanely fast" for you? I just compacted and it takes 1.5 - 3 seconds for me to access the launcher, depending on which one I have installed.

    Maybe I'll try a reset of the watch to see if it's something I've done that slows this down (installed to many apps maybe?).

    edit: After factory reset and removing all apps and installing only what apps I use the watch is now much quicker (Desktop Launcher loads in just under a second, Circles clock a little longer).

  • The file access speed is something I do plan to try and improve, but if you have a bunch of files (eg many apps) then it will affect the speed. If you notice an app that creates an abnormally large amount of files let us know though - it may be something that can be improved.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Launcher too slow

Posted by Avatar for Micha @Micha

Actions