Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of push functions #433

Closed
wants to merge 1 commit into from

Conversation

stellarhoof
Copy link
Member

@stellarhoof stellarhoof commented Feb 5, 2024

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.

@stellarhoof stellarhoof self-assigned this Feb 5, 2024
Copy link

changeset-bot bot commented Feb 5, 2024

🦋 Changeset detected

Latest commit: a4377a2

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 stellarhoof changed the title feature/improve push performance Improve performance of push functions Feb 5, 2024
@stellarhoof stellarhoof force-pushed the feature/improve-push-performance branch from aee1e9a to a4377a2 Compare February 5, 2024 19:29
@stellarhoof stellarhoof marked this pull request as draft February 5, 2024 19:41
@stellarhoof stellarhoof marked this pull request as ready for review February 5, 2024 19:42
@stellarhoof
Copy link
Member Author

Abandoning this PR in favor of deprecating F.push

@stellarhoof stellarhoof closed this Feb 5, 2024
@stellarhoof stellarhoof deleted the feature/improve-push-performance branch February 5, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant