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

cloneDeep is slow with lots of data #4097

Closed
fnberta opened this issue Nov 5, 2018 · 5 comments
Closed

cloneDeep is slow with lots of data #4097

fnberta opened this issue Nov 5, 2018 · 5 comments

Comments

@fnberta
Copy link

fnberta commented Nov 5, 2018

Starting with apollo-client:2.4.3 (which includes apollo-utilities:1.0.22), I noticed a severe downgrade in performance in applications that deal with a lot of data. Profiling them showed that a lot of time is spent in the cloneDeep function. Reverting to apollo-client:2.4.2 and apollo-utilities:1.0.21 solves the problem, so it seems like the implementation of cloneDeep introduced in #4032 is less efficient than the previous one.

@benjamn
Copy link
Member

benjamn commented Nov 5, 2018

You’re right about #4032, but this has been fixed since [email protected]: #4052

@benjamn benjamn closed this as completed Nov 5, 2018
@fnberta
Copy link
Author

fnberta commented Nov 5, 2018

Well I tried 1.0.24 as well. While the experience was better, it is still way slower than 1.0.22. The applications I tested with and run fine with 1.0.22 perform sluggish with 1.0.24. I'm happy to provide you with some profiling numbers if needed.

@fnberta
Copy link
Author

fnberta commented Nov 8, 2018

As promised, some not very scientific data. I just used an application of mine that consumes a quite big amount of data and triggered constants re-reads from the cache for 10 seconds. First image is with react-client 2.4.2 and apollo-utilities 1.0.21 and the second with the latest react-client 2.4.5 and apollo-utilities 1.0.25.
1 0 21
1 0 25
As you can see, in the first one, cloneDeep doesn't even show up in the the top time consuming functions when profiling. In the second though, it's at the very top.

Hence, I would suggest to re-open this issue.

@fnberta
Copy link
Author

fnberta commented Nov 13, 2018

@benjamn any chance you would consider re-opening this issue? If yes, I will try to provide a reproducable example project.

@abenhamdine
Copy link

@fnberta I suggest you to open a new issue

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants