Yomguithereal / baobab

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

Increase performance deep clone of Array #494

Closed anthony-redFox closed 7 years ago

anthony-redFox commented 7 years ago

map function calculate a length of Array on start of clone and doesn't change later

Chrome 63 beta image

IE11 image

From https://jsperf.com/map-vs-for-loop-performance/6

Yomguithereal commented 7 years ago

Thanks @anthony-redFox. Let me just point out something in the review to check.

Yomguithereal commented 7 years ago

You'll probably need to change your commit's description :)

anthony-redFox commented 7 years ago

@Yomguithereal done

Yomguithereal commented 7 years ago

Thanks @anthony-redFox. Will merge now.