unused imports for faster initial navigation #411
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUPERCEDED BY #416
Since commit 94abdd3 there is a noticeable delay after boot/restart moving from the MainMenu to Seeds or Tools. That commit does not look suspicious, but I suspect it is the result of a history-rewriting --rebase on the flow_tests commit which followed it.
I have yet to identify exactly which changes created this delay.
In the meantime, I've tried importing slow-to-load modules from the controller so that navigation is much faster once the main menu has loaded. If there is a cleaner way to do this, I'm game. Otherwise, these unused modules are
bound to a name 'unused' that is then deletedimported w/o local binding. I've opted to target the camera as it's the slowest, then the heaviest of screens ordered by heaviest-first, to avoid circular imports like would happen with views; my choices based on a threshold of 0.1 seconds on a pi2.This does result in a slightly slower boot and splash.
pi0 boots to splash in 19s, to main menu after 25s...