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

perf(chunk): remove clone #574

Merged
merged 2 commits into from
Apr 10, 2023
Merged

perf(chunk): remove clone #574

merged 2 commits into from
Apr 10, 2023

Conversation

kyranet
Copy link
Member

@kyranet kyranet commented Apr 4, 2023

Tested on an array with 21 elements:

Version 100,000 % 1,000,000 %
Old 257.704ms 100% 2.163s 100%
New 162.308ms 62.98% 1.532s 70.82%

The updated function also uses half as much memory, as it doesn't clone the array. The performance improvement should be even greater on larger arrays, as removing (or inserting) elements at the start of an array is the slowest array operation.

@kyranet kyranet marked this pull request as draft April 4, 2023 21:55
@kyranet kyranet marked this pull request as ready for review April 4, 2023 22:02
@favna favna merged commit 049047b into main Apr 10, 2023
8 checks passed
@favna favna deleted the perf/chunk/remove-clone branch April 10, 2023 19:28
goestav pushed a commit to goestav/utilities that referenced this pull request Jun 21, 2023
* perf(chunk): remove clone

* fix: resolved bug
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.

None yet

2 participants