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

makeLocalGetters performance hit on ssr #1539

Closed
frankcs opened this issue Apr 23, 2019 · 0 comments · Fixed by #1546
Closed

makeLocalGetters performance hit on ssr #1539

frankcs opened this issue Apr 23, 2019 · 0 comments · Fixed by #1546

Comments

@frankcs
Copy link
Contributor

frankcs commented Apr 23, 2019

Version

3.1.0

Reproduction link

https://codepen.io/frankcs/pen/NmOLNX

Steps to reproduce

Using vuex on ssr following the ssr guide. I have created an application with a large number of components and modules and therefore a large number of namespaced getters. Every time such a getter is invoked the makeLocalGetters function is called iterating trough all the getters in the store just to create the gettersProxy object. This is overkill for ssr performance and is being flagged as a CPU consuming process in the node profiler.
I have managed to double the number of requests per second my ssr app can handle just by using memoization on the gettersProxy object creation. I think this is really impacting performance.

What is expected?

Namespaced getters invokation not to be inefficient with large numbers of getters/modules

What is actually happening?

A lot of hits to makeLocalGetters making performance go down

@frankcs frankcs changed the title makeLocalGetters performance hit makeLocalGetters performance hit on ssr Apr 23, 2019
@ktsn ktsn closed this as completed in #1546 Nov 9, 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 a pull request may close this issue.

1 participant