Skip to content

Immutable data + bad performance #1262

@elado

Description

@elado

At real-world's entities reducer implementation, https://github.com/rackt/redux/blob/master/examples%2Freal-world%2Freducers%2Findex.js#L10

This approach seems to be super slow with bigger data sets (say, 1000 entities).

lodash.merge has its own performance problem, as 1000 entities take 2.5s, but spread copy {...state, ...} is still slow (~120ms)

Here is a comparisons of merge/spread/partial copy/mutable: http://jsbin.com/miroto/3/edit?js,console

Obviously, Redux lives on immutable data, so it needs to stay immutable. How do you deal with this performance hit when dealing with many entities?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions