Skip to content

Using lodash.isPlainObject in dispatch has performance overhead #2598

@hasyee

Description

@hasyee

I just created a performance comparison between Redux and Repatch: https://github.com/jaystack/redux-repatch-performance-comparison.

This comparison dispatches a big amount of pure actions (simple increment), and I found that Redux is too slow as we expect.

I discovered, that this assertion at dispatch causes this performance decreasing.

I suggest a simpler checking, like:

action && action.constructor === Object

if it's not necessary that action objects can made by Object.create(null).

With this enhancing redux dispatching will be 2 magnitude faster.

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