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

Various performance improvements to the store #5522

Merged
merged 1 commit into from
Aug 4, 2024

Conversation

absidue
Copy link
Member

@absidue absidue commented Aug 3, 2024

Various performance improvements to the store

Pull Request Type

  • Performance improvement

Description

As my store typings pull request seems to not work for some people (some IDEs struggle with the complicated type gynastics that were required to get that pull request to work), I've decided to extract the performance improvements from that pull request into their own one and add a few other minor improvements to the mix. That way we get those improvements regardless of whether we ever merge the other pull request.

Here is the list of improvements:

  • Pass the locale string to the getRegionData action directly instead of wrapping it in an object. Using an object is only necessary when an action takes multiple parameters.
  • Access the state directly instead of going through the getters, in some of the places that we weren't already doing that.
  • The list of settings that have side-effects never changes at runtime, so we have no reason to store it in the state and access it through a getter. We can just store it in a normal variable and access it directly to avoid the extra overhead.

Testing

Check that changing the locale still fetches the appropriate region translations.

Desktop

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

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 3, 2024
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) August 3, 2024 22:10
@FreeTubeBot FreeTubeBot merged commit ef0d69f into FreeTubeApp:development Aug 4, 2024
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 4, 2024
@absidue absidue deleted the store-perf branch August 4, 2024 13:35
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Aug 6, 2024
* feature/better-new-window:
  * Update top nav to move query text to new window instead of remaining in old window
  Revert "Bump the babel group with 2 updates (FreeTubeApp#5526)"
  Bump electron from 31.3.0 to 31.3.1 (FreeTubeApp#5529)
  Bump eslint-plugin-n from 17.10.1 to 17.10.2 in the eslint group (FreeTubeApp#5527)
  Bump the babel group with 2 updates (FreeTubeApp#5526)
  Bump mikefarah/yq from 4.44.2 to 4.44.3 (FreeTubeApp#5525)
  Bump stylelint from 16.7.0 to 16.8.1 in the stylelint group (FreeTubeApp#5528)
  Bump swiper from 11.1.8 to 11.1.9 (FreeTubeApp#5530)
  Various performance improvements to the store (FreeTubeApp#5522)
  Small cleanup after the YouTube.js update (FreeTubeApp#5520)
  Translated using Weblate (Finnish)
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