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

[RTKQ]: copyWithStructuralSharing peformance issue #1896

Closed
zoubingwu opened this issue Jan 6, 2022 · 4 comments · Fixed by #1954
Closed

[RTKQ]: copyWithStructuralSharing peformance issue #1896

zoubingwu opened this issue Jan 6, 2022 · 4 comments · Fixed by #1954
Labels
enhancement New feature or request

Comments

@zoubingwu
Copy link

zoubingwu commented Jan 6, 2022

I was testing with mock data, some request returns an array of thousands of items, and it freezes for like 10+ second so I found this:

image

I know with that amount of data it should be done with paginations or other techniques but this happens in real world.

The JSON.parse is fairly quick, and most of the time it was executing copyWithStructuralSharing, so just wondering what it does and is it possible to make it better?

@phryneas
Copy link
Member

phryneas commented Jan 6, 2022

Already 3 seconds for JSON.parse?
Tbh, I would not have expected anyone to handle these amounts of data.

At the moment, there is no way to skip it, but I could see us adding a structuralSharing: false option to endpoints.

@phryneas
Copy link
Member

Hey @zoubingwu. @msutkowski has implemented an option for this over in #1954 - could you please try out the CI build and report back if it solves your problem?

@zoubingwu
Copy link
Author

@phryneas Yep, just tried https://pkg.csb.dev/reduxjs/redux-toolkit/commit/738faa66/@reduxjs/toolkit this build and indeed it worked as expected. Thanks!

@phryneas
Copy link
Member

phryneas commented Feb 3, 2022

Released in https://github.com/reduxjs/redux-toolkit/releases/tag/v1.7.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants