r/javascript • • Mar 20 '22

A real-world example of Improving JavaScript performance

https://www.the-koi.com/projects/an-practical-example-on-improving-javascript-performance/
51 Upvotes

11 comments sorted by

View all comments

15

u/realPubkey Mar 20 '22

Tldr; use flat clone instead of deep clone

11

u/Nullberri Mar 21 '22

It's maybe sillier than that.

use deepclone when you actually need it, if you don't need a deep copy you can use a shallow clone.