[solved] BangleJS2 slow

Posted on
  • Hi all,

    I know, BangleJS2 is work in progress and I use it every day. I definitely enjoy the working notifications and vibration.
    But at one time it got a lot slower. I guess it was, when I upgraded firmware to 2v11, but I'm not sure.
    I attached a video that shows entering menu and leaving it from/to circles clock. Of course, circles clock may also be the reason for the watch being slow.

    I just wanted to ask, if:

    1. the watch is slow now and I have to cope with it or
    2. if that's just my watch and there's something I can do to speed it up again

    So, does someone else have a slow BangleJS2?


    1 Attachment

  • I see the same kind of sloweness after having set the watch up the way I want. As far as I understand, this issue should be remedied with the JIT compiler that was a stretch goal on the Kickstarter campaign. Status page: https://github.com/espruino/BangleApps/w­iki/Bangle.js-2-Status

  • Hi,

    I think most likely the issue is that Storage is getting full - to reduce flash wear Bangle.js only marks files as deleted but doesn't actually get rid of them until it needs to. It means that it ends up searching through a bunch of deleted files just to find the files it needs, which slows it down.

    You can just run Compact from Utils in Settings, but I have had reports that it can 'break' the filesystem and cause everything to be reset to factory state. I am looking into that though so it should be fixed soon.

  • Yup... That made the watch much more responsive. And no factory reset (this time around).

  • @johan_m_o if there's a specific sequence of events you follow from a clean slate than make it very slow, maybe you could post up so I can reproduce it here?

    If you can do that from an 'install default apps' there's a high likelihood it's some app/widget that's not behaving.

    The JIT compiler on the kickstarter will speed up apps when running, but likely won't speed up actually switching apps as in that case it's rare the bottleneck is actual computation, it's just having to load a bunch of stuff.

  • @Gordon Hard to say... I'm one of those that tinker a lot, so I'm not surprised that there'll be a lot of garbage needing to be taken out once in a while. I'll see if there's anything I can do about reproducing it reliably.

    And thanks for clearing up things about the JIT compiler. Too bad though... I think the slow load times that turn up after having used the watch a while is pretty much the only gripe I have with it.

  • The 2v11 firmware had a really big improvement with a file cache which should have drastically boosted load times (at least it did for me). It's also worth checking that Pretokenise apps before upload is turned on in your app loader.

    There are other possibilities for making things faster as well - we can access flash memory via the CPU's own hardware, and we can improve the loadWidget code to cache all the widgets too. It's all stuff that is planned, but right now it's really just trying to get the basics right.

  • You can just run Compact from Utils in Settings, but I have had reports that it can 'break' the filesystem and cause everything to be reset to factory state. I am looking into that though so it should be fixed soon.

    oooh, so that's what happened to my Bangle then.
    Curious about this "compact" function, I clicked on it, but as the operation lasted a little long, I didn't pay attention to it anymore.
    A few hours later, I found my Bangle stuck on an error screen and had to do a reboot, which left me with a Bangle empty of any app.
    But I hadn't made the connection with the fact that I had started the compaction.
    Via WebIDE, I could see that some files were still here, as well as files with names containing random characters that I never managed to delete.
    I restored the Bangle and the applications that had disappeared, but the corrupted files are still here...

    Not a big deal, but I'm glad to know that it was my curiosity that made me get this

  • I confirm it! I had this: I lost all applications and all data after running the Compact. Unfortunately, I also lost important data (GPS routes).

  • did it reboot as part of compact? normally it should not do that, to know more you could connect via ide and run it directly in console - left side of ide, require("Storage").compact() it should take some time and return back to console, if you see data corruption later even if it does not crash in the middle of compact it is strange. after compact you can run E.reboot() to restart the watch, that should do no harm.

  • @Gordon I have to be honest I have only ever had compact work for me once when I had little churn on the storage. I reckon by the time you have gone through 50 cycles of write and app file/delete an app file- the storage is in a state to fail the compacting process. You would need to have a list of the files in storage before compact runs and then also check immediately afterwards as it is not always obvious that you have lost data or apps. You just see apps missing from the launcher as if they had been deleted.

    Is it worth someone developing a storage fragmenter app, ie dilerberately simulate writing app files of random sizes (from min to max app size) to the storage then delete them, then repeat. Then run compact(). IE a stress test for the storage code and the compact code.

  • I tend to factory reset and install favourite apps once a month. It all depends how much developing I do, and uploading the same file multiple times, slightly changed etc.

  • Is it worth someone developing a storage fragmenter app, ie dilerberately simulate writing app files of random sizes (from min to max app size) to the storage then delete them, then repeat. Then run compact()

    If someone was able to create a tool that made compaction break that'd be amazing. I've started a new thread for this at http://forum.espruino.com/conversations/­372304/#comment16370148

  • Hi all,

    thank you all for your replies. I executed compact via Web IDE and had no problems with. It went through and I would say my BangleJS2 is faster now 🎉
    I recorded a video showing it speeded up. Thanks!

    I also made a video executing compact but since there was no problem, I didn't upload it. If you want it anyway (about 100MB) I can upload that one, too.

    One feedback about executing compact from WebIDE though: I didn't know if it was stuck or if it even started. I didn't have visual feedback on my Bangle nor a message "Compacting started" or so. Would be great to have that.

    Yours
    Graphity


    1 Attachment

  • Great! Glad that fixed it!

    Yes, you don't get much feedback when executing commands from the Web IDE. However, if you execute from the Settings menu then you should get an on-screen message showing it's doing something :)

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

[solved] BangleJS2 slow

Posted by Avatar for Graphity @Graphity

Actions