Optimize large asset loading for 80% performance improvement #377
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.
Pull Request Description:
Issue: In the project, we encountered a delay in the splash screen animation on less powerful devices. The size of our animation was 4.6 MB. After some analysis, I noticed that the most time-consuming part was the loop responsible for loading images.
Solution: To address this without breaking other logic, I opted for the safest approach by using Future.wait to parallelize image loading. This optimization led to a significant performance improvement of 80%. The average execution time dropped from 2300ms to 300ms after this adjustment.
This change should enhance the user experience by reducing the delay in displaying the splash screen animation.