Skip to content

The cloneDeep method of lodash has serious performance bug #5535

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

Closed
jerico-tech opened this issue Oct 19, 2022 · 2 comments
Closed

The cloneDeep method of lodash has serious performance bug #5535

jerico-tech opened this issue Oct 19, 2022 · 2 comments
Labels

Comments

@jerico-tech
Copy link

There is data with size about 15 MB in our system. Using the cloneDeep method of lodash, the execution time needs more than 45 seconds. As a result, the page is blank for a long time. We hope that the bug can be fixed ASAP.Thank you.

@rilysh
Copy link

rilysh commented Oct 24, 2022

Instead of lodash, you can also give it a try with Object.assign. However, there are a few more ways to clone objects. Or you can simply use the spread operator. I assume the performance issue happens with the recursive cloning with lodash.

@jdalton
Copy link
Member

jdalton commented Jan 4, 2023

@jerico-tech I'd look for a more native solution. Try structuredClone available in browsers and Node 17.

@jdalton jdalton closed this as completed Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants