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: use fewer slices in while loop #1

Closed
wants to merge 1 commit into from
Closed

Perf: use fewer slices in while loop #1

wants to merge 1 commit into from

Conversation

Beanow
Copy link
Owner

@Beanow Beanow commented Sep 11, 2017

Should boost performance significantly for larger incoming buffers.
This fixes the issue for me at ipfs-inactive/js-ipfs-unixfs-engine#187

The way I implemented my test, a single buffer of 57621555 bytes comes in and gets split into ~220 blocks. By not slicing the remainder to a new buffer 219 times it saves a lot of buffer allocation churn to process a buffer as large as this.

Should boost performance significantly for larger incoming buffers.
@Beanow
Copy link
Owner Author

Beanow commented Sep 11, 2017

Pff, wrong target. Note to self: check what github suggests before pushing green buttons.

@Beanow Beanow closed this Sep 11, 2017
@Beanow Beanow deleted the perf-fix branch October 14, 2017 07:56
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