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

Use the length from the message to pre-allocate the result array #771

Merged
merged 2 commits into from
Jun 23, 2020

Conversation

ankon
Copy link
Contributor

@ankon ankon commented Jun 21, 2020

This can help to improve performance ever so slightly -- but then again this is called in a tight loopy environment, so everything counts.

See https://jsperf.com/best-init-array/3 for a performance indication.

@ankon ankon force-pushed the pr/decoder-use-length-hint branch from 339eb2b to df38950 Compare June 21, 2020 15:56
@Nevon Nevon merged commit cc25c1e into tulios:master Jun 23, 2020
@ankon ankon deleted the pr/decoder-use-length-hint branch June 23, 2020 15:51
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.

2 participants