Yomguithereal / baobab

JavaScript & TypeScript persistent and optionally immutable data tree with cursors.
MIT License
3.15k stars 117 forks source link

Improve the performance of deepClone when immutability is off? #445

Open jrust opened 8 years ago

jrust commented 8 years ago

In production we turn off immutability for performance and I'm wondering if calls to cursor.deepClone() should/could be a no-op? The original intent behind deepClone was to get the object back in a mutable form which is why I'm thinking it could make sense to skip the cloning if it is already mutable.

Yomguithereal commented 8 years ago

If you don't need persistence, you can also disable the persistent option and this will improve your performance even more.