Skip to content

makeLocalGetters performance hit on ssr #1539

Closed
@frankcs

Description

@frankcs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions