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

Disable store strict mode, due to performance problems because of the amount of data in the store #6469

Merged
merged 1 commit into from
Dec 29, 2024

Conversation

absidue
Copy link
Member

@absidue absidue commented Dec 28, 2024

Disable store strict mode, due to performance problems because of the amount of data in the store

Pull Request Type

  • Other - Refactor

Related issue

#6414 (comment)
#6414 (comment)

Description

Vuex's strict mode is intended to warn you about modifications to the store state outside of mutations as those are unsafe and can cause problems with the changes not getting tracked and propagated properly. However as it works by adding a deep watcher to the store, the performance impact it has is directly connected to the amount of data in the store and the amount of reads and writes that you do, unfortunately we have reached a point where we have so much data in the store (and are planning to keep adding more, with it being unlikely that we will scale back (removing features anyone?)), that it causes noticable slow downs.

This pull request disables those safety checks in vuex to get the performance back to an acceptable level but we just need to be more careful when writing code that interacts with the store, as we won't get "automated" warnings anymore about unsafe code.

I also fixed the grabAllProfiles action accessing the state in the wrong way.

Testing

  1. yarn dev
  2. It should be faster

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 70b616a

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) December 28, 2024 23:03
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Dec 28, 2024
@kommunarr
Copy link
Collaborator

It hasn't bothered me so far, but I'm on board if it's meaningfully hampering anyone's 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.

It works but not sure how to know it's faster

Anyway time to explode
giphy-757997834

@PikachuEXE PikachuEXE mentioned this pull request Dec 29, 2024
1 task
@FreeTubeBot FreeTubeBot merged commit 5cc41cd into FreeTubeApp:development Dec 29, 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 Dec 29, 2024
@absidue absidue deleted the store-strict branch December 29, 2024 00:38
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Dec 30, 2024
* development: (75 commits)
  Bump lefthook from 1.10.0 to 1.10.1 (FreeTubeApp#6480)
  Bump bgutils-js from 3.1.0 to 3.1.1 (FreeTubeApp#6482)
  Translated using Weblate (Estonian)
  Translated using Weblate (Serbian)
  Translated using Weblate (Polish)
  Translated using Weblate (Czech)
  Translated using Weblate (English (United Kingdom))
  Translated using Weblate (Hungarian)
  Translated using Weblate (Hungarian)
  Translated using Weblate (German)
  Translated using Weblate (Italian)
  Translated using Weblate (French)
  Translated using Weblate (Chinese (Simplified Han script))
  FtRadioButton and FtCheckboxList v-model and composition API (FreeTubeApp#6463)
  Disable store strict mode, due to performance problems because of the amount of data in the store (FreeTubeApp#6469)
  [Feature] Playlist: Sort videos by published date (FreeTubeApp#6280)
  Migrate ChannelAbout to the composition API (FreeTubeApp#6470)
  Translated using Weblate (German)
  compress frappe svgs (FreeTubeApp#6467)
  Translated using Weblate (Hungarian)
  ...
SuperAKWA pushed a commit to SuperAKWA/FreeTube that referenced this pull request Jan 24, 2025
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