Yomguithereal / baobab

JavaScript & TypeScript persistent and optionally immutable data tree with cursors.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve the performance of deepClone when immutability is off?

jrust opened this issue · comments

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.

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