Skip to content

strict mode is slow, I had to disable it even when debugging #659

Closed
@Lesiuk

Description

@Lesiuk

I'm using https://github.com/Starcounter-Jack/JSON-Patch to apply patches to state in my mutations and I noticed that with around 1 000 changes my application becomes unresponsive for 3 seconds (100% cpu usage on 1 core). When I disable strict mode I can even apply 100 000 changes without any lag.

I think It's because of this code.

function enableStrictMode (store) {
store._vm.$watch(function () { return this._data.$$state }, () => {
assert(store._committing, 'Do not mutate vuex store state outside mutation handlers.')
}, { deep: true, sync: true })
}

It probably should be noted inside documentation that stirct mode makes changing state really slow.
I lost few hours debugging it.

Anyway, vuejs & vuex are great. Thank you.

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