New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Desktop Launcher] Fast load to clockface on B2 #2235
Conversation
apps/dtlaunch/app-b2.js
Outdated
delete i; | ||
delete drawIcon; | ||
delete drawPage; | ||
delete isTouched; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of these are not needed, everything defined in the block scope with let/var can be garbage collected automatically. It can be useful to delete some big vars beforehand to have more memory for the app that should be loaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the garbage collector should be as fast as having delete statements like this, or probably faster?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed a bunch of delete statements. Unsure if those left should be removed as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the GC will be faster - when the block goes out of scope, everything will be freed in one go
Excellent - thanks! You could also look at adding the 'app cache' we've used in the other launchers too - that can really speed up the loading if you have a bunch of apps |
I might look at it! If anyone beats me to it, that will just be great ;) |
Fast loading requested here.
I changed most instances of var to let.
There is some small ram leak going back and forth between this dtlaunch and the slope clock, but pretty minor by my judgement. Edit: This has been solved with @halemmerich's help.
Edit: Added in the timeout to clock functionality from Icon Launcher.