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

Optimize GUI performance #231

Merged
merged 3 commits into from Nov 8, 2019
Merged

Optimize GUI performance #231

merged 3 commits into from Nov 8, 2019

Conversation

gary-lgy
Copy link

@gary-lgy gary-lgy commented Nov 7, 2019

Previously, a MemeCard/TemplateCard/ImportMeme card is created anew
whenever the GridCell is updated. This results in a lot of lagging and
explosive memory usage when scrolling because scrolling updates the GridCell and MemeCard/TemplateCard/ImportMeme reads
the image from the disk in their constructors. (Imagine if the user is using HDD)

With this commit, MemeCard/TemplateCard/ImportMeme are cached in their
parents and no repeated disk IO is made. Memory usage now is about 500MB
for ~500 memes and does not increase when scrolling.

The respective GridViews can scroll smoothly now. Tested with 1000 memes
and no significant lag is observed.

Demo: (the screen recorder was consuming a lot of resources, actual performance should be better than this)
weme_no_lag

@gary-lgy gary-lgy mentioned this pull request Nov 7, 2019
@gary-lgy gary-lgy force-pushed the gary/optimize branch 2 times, most recently from ce7f3b9 to 75566d8 Compare November 8, 2019 03:07
Previously, a MemeCard/TemplateCard/ImportMeme card is created anew
whenever the GridCell is updated. This results in a lot of lagging and
explosive memory usage because MemeCard/TemplateCard/ImportMeme reads
the image from the disk everytime it is created.

With this commit, MemeCard/TemplateCard/ImportMeme are cached in their
parents and no repeated disk IO is made. Memory usage now is about 500MB
for ~500 memes and does not increase when scrolling.

The respective GridViews can scroll smoothly now. Tested with 1000 memes
and no significant lag is observed.
@jonchan51 jonchan51 merged commit 2094634 into master Nov 8, 2019
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

2 participants