smartprocure / futil-js

F(unctional) util(ities). Resistance is futile.
https://smartprocure.github.io/futil-js/
MIT License
991 stars 68 forks source link

Improve performance of push functions #433

Closed stellarhoof closed 8 months ago

stellarhoof commented 8 months ago

The current implementation of push and pushIn use concat to append the new elements at the end of the array to stay immutable which is very slow compared to a simple [].push since it shallow clones the passed array.

This PR is a change in semantics for these functions since they are now mutating the passed array.

changeset-bot[bot] commented 8 months ago

🦋 Changeset detected

Latest commit: a4377a22674d8463bc5ce4b651d3995997b84bf7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | -------- | ----- | | futil-js | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

stellarhoof commented 8 months ago

Abandoning this PR in favor of deprecating F.push