Bangle.js 2 speedups #5708
Replies: 1 comment
-
Posted at 2022-11-02 by PeerDavid Oh wow it definitely feels much faster now and I love your new slopeclock! Looks really really great and the animation is really smooth :D Nevertheless, I think I found one little issue -- but I'm not 100% sure if its the settings app or the firmware update: I can no more open the LCD settings -- I already tried to re-write the settings, I tried an older settings version (0.49) and I removed the setting.json file completely, but I always get the following error (read via Web IDE):
Update1: I also downloaded the setting.json file if it helps as it seems that some props are missing in my settings.json file. Attachments: Posted at 2022-11-02 by rigrig I had the same issue a while ago (missing property from Posted at 2022-11-02 by @thyttan It's not news I really appreciate the speedups, not having to wait for the watch is a huge quality of life improvement - thanks! Slope clock is very stylish! :D Posted at 2022-11-03 by @gfwilliams @peerdavid that's an odd one - it looks like something did get corrupted, but I'm not sure how... but the settings app should be able to cope with a corrupted file anyway. I'll take a look and get a change in (it looks like it'll be as easy as checking if ... but I'd love to know why it got messed up in the first place. Posted at 2022-11-03 by user150560 Just got my Bangle and am absolutely loving it. Updates like this are just the cherry on top. Posted at 2022-11-04 by @gfwilliams Thanks! That's great to hear! @peerdavid I just updated settings to stop this happening in future, but if you ever get an idea what might have been breaking the settings.json in the first place I'd love to hear it (could qmsched have had an effect?) Posted at 2022-11-04 by PeerDavid Thanks a lot!
Posted at 2022-11-04 by Alessandro Nice! I just noticed an issue with Swiper Clock Launch: I can navigate from Clock to Launcher but Launcher to Clock does not work anymore. I already did a settings rewrite. No errors in the console. btw slope clock is really cool! Posted at 2022-11-04 by @gfwilliams @alessandro I just updated 'Swiper Clock Launch' so it should fix this. Posted at 2022-11-04 by fanoushs-punching-bag @gfwilliams, excellent work! I love seeing the changes coming to the Bangle! Posted at 2022-11-04 by HughB @gfwilliams - nice one. Blisteringly fast. Nice to see the original Anton Clock back as well. Posted at 2022-11-05 by Alessandro Thank you :) Posted at 2022-11-05 by @gfwilliams I had an idea last night, and now graphics fills in 2v15.93 are around 6x faster than in 2v15 (4x faster than 2v15.90). So even if you updated to 2v15.90, updating again is probably worth it - hopefully it'll make a really big difference to the way the watch feels. I'll try and get a 2v16 release out next week so the improvements can roll out to more people. Posted at 2022-11-05 by Hank Is the fast switch something that needs to be implemented into the launcher? Posted at 2022-11-05 by @halemmerich Yes, the launcher currently needs to load the clock app using The clock needs to use If clock and launcher are implemented this way, fast switching between those works. If only one of launcher and clock use this way fast switching only works while leaving that app. Posted at 2022-11-05 by @thyttan I did some work on getting Posted at 2022-11-05 by Mi Glitch - special to Circles Clock or hint to general problem? @gfwilliams Not a big deal for me. Wanted to let you know in case this is symptom of some general problem before it goes into a stable 2.16 [Update]: Hmm, now bootloader was updated (was not shown before?) Posted at 2022-11-06 by @thyttan I couldn't stop myself, so here's a PR with fast switching implemented for Desktop Launcher. Posted at 2022-11-06 by Chasolla 93 seems to have broken some of the lcd settings. Posted at 2022-11-06 by @thyttan After toggling Wake on twist, try forcing 'rewrite settings' under utils in the settings. If that works at least it's a temporary fix :) (I just tried and had the opposite problem of yours before forcing the rewrite of settings) Posted at 2022-11-06 by Chasolla Thanks, that worked. You may have saved my marriage. Posted at 2022-11-07 by @gfwilliams
I think I introduced an issue in Posted at 2022-11-07 by rigrig Not sure if it's worth it, but the app loader tried minifying all code a while ago. Back then it broke apps, because Espruino didn't support Posted at 2022-11-11 by @gfwilliams Interesting - I'd forgotten about that and assumed that we minified! Maybe it could be another option in the App Loader for now so that it can be turned on for those that are interested? Posted at 2022-11-11 by rigrig
That sounds like a good idea. Posted at 2022-11-11 by @gfwilliams
I think there's a good chance. Espruino generally stores and searches for vars more efficiently when they are 4 chars or under long, so even on its own that would help. I don't think the current minifier is smart enough to do constant folding, but if it was that would really help. I'm just about to do some tweaks to the app loader anyway, so I'll add this at the same time Posted at 2022-11-11 by @gfwilliams Ok, just added this to the dev app-loader as a setting. It broke the 'app.settings.js' files because their format meant the JS didn't have side-effects, so I had to do a quick hack to disable that. Otherwise it seems to work ok with the default apps - I'd be interested to see if it stops any from working. Quick tip: You can change the setting and then do edit: did a quick check with Anton clock and it doesn't appear to make any real difference to speed, but other apps may benefit... Posted at 2022-11-14 by user140377 Fyi: I'm running 2v15.93 for more then a week now without any noticed problems. Posted at 2022-11-14 by rigrig I just reinstalled all minimized apps, and so far at least nothing seems to be broken. Posted at 2022-11-15 by Hank So I added a bit in espruino/BangleApps#2276 but the IDE shows
Did I do something wrong? Posted at 2022-11-15 by @gfwilliams You mean for The fast loading won't work if the clock doesn't have widgets - because it'd have to handle loading widgets for the next app and then somehow handle unloading then when you switched back to the clock. Posted at 2022-11-15 by @halemmerich Maybe the clock was manually set before the changes to the boot code and there is no value for settings.clockHasWidgets? In that case setting the clock again in the settings app should help. It seems to work for me. Edit: Actually works only once, it seems some more cleanup is needed. The app does not run in a scope and actively only cleans up the timeouts/intervals. So all variables stay globally available and that clashes on reloading the app during Posted at 2022-11-15 by Hank
yes.
Bummer, I hoped it was easier. Could you guys help me to tidy up the watchface somehow? Posted at 2022-11-15 by @thyttan @gfwilliams and @halemmerich have given some pointers following comment #63 in the POC-thread. Information on how to declare functions with It basically boils down to:
For now it's generally best to only implement fast switching between clocks and launchers, and not for launching other apps or switching between them. There're also instructions going into the hardware reference here following line 5171. Examples where it's implemented: Slope clock, Desktop Launcher. EDIT: Using the RAM Widget have helped me during development. @gfwilliams has also suggested entering Posted at 2022-11-15 by @halemmerich Edit: Removed duplication with @thyttan earlier post.
I use the following uploaded to RAM to do a smoke test for memory leaks:
This code loads the app over and over. It usually settles in after 1 or 2 iterations and does not change a lot after that with most apps. This will not cover all cases, but it should give you a start. As usual, do changes piece by piece and test between steps. Posted at 2022-11-16 by Hank Thanks for those suggestions. Though, I am still not sure with the variables as I use some of them globally, so I use var instead of let. What's the best practice on that? Posted at 2022-11-16 by @halemmerich I have found two apps breaking with the new minification switch: imageclock and gpstrek. Imageclock breaks because the code generated by the customizer (and evaled in the app) references things that have been renamed by the minifier. What is the best way around this? Defining those globally and deleting them on remove? In gpstrek the minifier generates code like Edit: During experimenting with iconlaunch the minifier generated a constant named Posted at 2022-11-17 by @gfwilliams Hmm, ok. Maybe start a new thread for minifier problems?
I think there are 3 options?
It looks like a minifier bug?
That feels like another minifier bug? I'd be interested to know what speed improvements you're seeing, because if it's not that much I wonder whether we should just consider not using minification. Posted at 2022-11-17 by @halemmerich Posted at 2022-11-17 by Rarder44 hello, i have the same problem with iconlaunch and rebble.
does this mean that the fastload ( Bangle.showClock() ) will never work with full screen clocks? sorry in advance if I misunderstood Posted at 2022-11-18 by @gfwilliams
Yes.
with this code: espruino/BangleApps@779b16b Posted at 2022-11-18 by @gfwilliams Just a note on this - I made a few more changes that squeezed another 10% or so performance boost out of the external flash. So I'm pretty pleased with where we are now: Bangle.js 2v15 - factory default firmware. Boot to watch via So we're almost twice as fast normally, and then around 3.5x faster when swapping to/from the launcher! Posted at 2022-11-18 by @thyttan Wow, very nice - impressive improvement! Posted at 2022-11-18 by @halemmerich Those are some really great numbers, definitely easy to see in daily use. The not yet fast load compatible clocks could be changed to loading widgets and then directly hiding them using Posted at 2022-11-18 by @gfwilliams
Yes... Personally now 2v16 has overlays that can go offscreen I'd like to see as many watches as possible load the widgets and then put them offscreen so a downwards swipe would show them. I'll see about extending widget_utils to make that possible + easy Posted at 2022-11-29 by fanoushs-punching-bag I would like to second what you're saying @gfwilliams. The swipe launcher should avoid the downward swipe as well. Posted at 2022-11-29 by @thyttan Do you mean Quick Launch? Maybe the swipe down action should be remapped to act on duoble down swipes instead. I'll probably do a PR for that. Posted at 2022-11-29 by user140377 Quicklaunch: Please make it configurable, I would like to keep single down swipes. Also I would like the widgets to stay always visible on Anton Clock Plus. Posted at 2022-11-29 by fanoushs-punching-bag Actually, Quicklaunch might already have it, simply because you just make it do nothing with single down swipes? Perhaps. Posted at 2022-11-29 by @halemmerich Double swipes could be useful as an additional way to start more applications. Users not wanting to use the single swipes can just leave those unused. Posted at 2023-02-09 by @thyttan Never got around to this, and I feel it isn't needed now as clock_info's take precedent over quicklaunch when selected. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-11-02 by @gfwilliams
Hi,
I've been putting a lot of work into Espruino's speed recently, so if you're on (or upgrade to) a cutting edge build (2v15.90 or later) with the latest apps from the app loader hopefully you'll see some big improvements.
I'd be really interested to see how you find this... Specifically Clock->Launcher->Scroll->Clock interactions should be hugely improved.
If you encounter issues, please revert back to 2v15 and check they don't exist there - but if you're sure it is something that's broken due to these changes please do let me know in this thread.
... I also added another new clock based on a suggestion from some time ago: https://banglejs.com/apps/?id=slopeclock
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions