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

App performance is reduced #222

Open
jimbrew opened this issue Feb 15, 2021 · 2 comments
Open

App performance is reduced #222

jimbrew opened this issue Feb 15, 2021 · 2 comments

Comments

@jimbrew
Copy link

jimbrew commented Feb 15, 2021

This slows down the performance of my application, I have used reducer to only get the stores needed and I did try filter to only use the required migrations. Both have made no difference.

I then used filter: (mutation) => console.log(mutation.type) to check what mutations were being called a lot and what might be affecting performance. However, this seems to have fixed the issue. Is there anything I can do to improve performance because consoling out the mutation isn't really a long term solution?

@ByMykel
Copy link

ByMykel commented Mar 2, 2023

@jimbrew You can use filter to filter the mutation you are not using. I had a similar problem where I din't use filter and it made the web crush.

@dotKokott
Copy link

dotKokott commented May 9, 2023

@jimbrew the reason why your performance is getting better after using filter: (mutation) => console.log(mutation.type) is that this function is supposed to return true for mutations to persist and false for mutations to ignore.

console.log(...) evaluates to false so you are logging all the mutations but filtering them all out. None of them being persisted by vuex-persist.

What helped us with performance is adding the specific module we want to persist

// only persist userState module
  modules: ['userState'],

However it is strange how slow it gets. For a 15k loc store (in local storage as json) it is taking almost 2 seconds to commit.

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

No branches or pull requests

3 participants