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

Drastically improve loading speed of the settings page #2452

Merged

Conversation

absidue
Copy link
Member

@absidue absidue commented Aug 4, 2022


Drastically improve loading speed of the settings page

Pull Request Type
Please select what type of pull request this is:

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Description
This pull request fixes the slow loading of the settings page by only loading the language list once, instead of the 45 times it does it at the moment (once outside of the loop and once for each language inside the loop). As the list of language names is also regenerated when you choose a different language, this change also speeds up that as well.

Illustration of what it feels like to open the settings page now:

speed

Screenshots (if appropriate)
Here is how long it takes to generate the list of language names with and without this change. The numbers are in milliseconds.

settings_locale_list_performance

Testing (for code that is not small enough to be easily understandable)
Open the settings page and change language. You will definitely notice the difference, if you don't then your computer is too fast (I would definitely like to borrow it at some point).

Desktop (please complete the following information):

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0.17.0

@absidue absidue added the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 4, 2022
@PrestonN PrestonN enabled auto-merge (squash) August 4, 2022 21:43
@efb4f5ff-1298-471a-8973-3d47447115dc

@absidue your illustration really made laugh out loud hard. Definitely caught me off guard there.

You also made me chuckle when i read everything below testing.

Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally
Slight difference spotted
OK I got faster computer

Copy link
Member

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before: 🏃💨
After: 🚀🚀🚀

Edit: noticeable performance improvement

@PrestonN PrestonN merged commit 620e2ea into FreeTubeApp:development Aug 5, 2022
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 5, 2022
@absidue absidue deleted the fix-settings-load-performance branch August 5, 2022 20:48
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.

5 participants