-
Notifications
You must be signed in to change notification settings - Fork 7k
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 performance #1984
Comments
Hi @elado! Our deep clone perf compared to others or I'd like to avoid explicitly calling out perf. We already cover the things |
I think you should call out performance explicitly while at the same time mentioning that other cloning modules may not handle all of the cases you do. cloneDeep performance issues have become the biggest slowdown in my current application so I will have to find another module. The reason I had used this clone rather than other modules, and also had not considered it was giving a problem was because of the reputation of lodash. |
Use the tool that's best for your situation. If a generic recursive clone with circular reference guards doesn't fit your needs, then by all means use another clone that does. |
Compared to other clone packages or a simple
JSON.parse(JSON.stringify(o))
,_.cloneDeep
is extremely slow. WhileJSON
isn't always a good fit (e.g. when copying a function) it's still faster.Is there anything
_.cloneDeep
is doing that the other implementation doesn't?The text was updated successfully, but these errors were encountered: