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: make _occ Uint8Array #176

Merged
merged 1 commit into from
Nov 28, 2024
Merged

perf: make _occ Uint8Array #176

merged 1 commit into from
Nov 28, 2024

Conversation

gurgunday
Copy link
Member

needle is a buffer, and _occ only takes buffer values (0-255), so it's more optimized (memory wise) to use an immutable Uint8Array here

Bench (node 22):

pr:

> busboy-benchmarks@1.0.0 benchmark-fastify
> node busboy/executioner.js -c 1

Mean time for fastify-busboy is 165742.53108811888 nanoseconds
all done

master:

> busboy-benchmarks@1.0.0 benchmark-fastify
> node busboy/executioner.js -c 1

Mean time for fastify-busboy is 166201.7394516819 nanoseconds
all done

@gurgunday gurgunday requested review from kibertoad, Uzlopak and a team November 28, 2024 10:57
@gurgunday gurgunday merged commit 67b2cbb into master Nov 28, 2024
14 checks passed
@gurgunday gurgunday deleted the occ-type branch November 28, 2024 11:04
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