Skip to content
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

Merged
merged 13 commits into from Nov 7, 2022

Conversation

thyttan
Copy link
Collaborator

@thyttan thyttan commented Nov 6, 2022

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.

apps/dtlaunch/app-b2.js Outdated Show resolved Hide resolved
delete i;
delete drawIcon;
delete drawPage;
delete isTouched;
Copy link
Collaborator

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.

Copy link
Collaborator Author

@thyttan thyttan Nov 6, 2022

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?

Copy link
Collaborator Author

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.

Copy link
Member

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

@thyttan thyttan marked this pull request as draft November 6, 2022 19:11
@thyttan thyttan marked this pull request as ready for review November 6, 2022 19:22
@gfwilliams
Copy link
Member

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

@gfwilliams gfwilliams merged commit 4a7a4f6 into espruino:master Nov 7, 2022
@thyttan
Copy link
Collaborator Author

thyttan commented Nov 7, 2022

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 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants