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

Reduce b4a usage and prefer the native Buffer methods #163

Closed
wants to merge 1 commit into from

Conversation

SukkaW
Copy link

@SukkaW SukkaW commented Jan 13, 2024

The PR reduces some b4a usages:

By replacing those b4a usage with Node.js built-in Buffer, the PR improves performance (as those alias methods would create extra stacks), and makes it easier to transition to the Uint8Array in future PRs.

The unit tests still pass after the changes.

@mafintosh
Copy link
Owner

The b4a is there to make it run in the browser, overhead is negligible, and prop even optimised out by v8

@SukkaW
Copy link
Author

SukkaW commented Jan 13, 2024

The b4a is there to make it run in the browser, overhead is negligible, and prop even optimised out by v8

@mafintosh Sure, that makes sense.

My original plan was to entirely transition from Buffer to Uint8Array as a preliminary step towards resolving the issue #157. This would begin with unifying Buffer usage followed by subsequent PRs focusing on migrating away from Buffer.

Maybe I should open a PR to migrate to Uint8Array directly, what do you think?

@SukkaW SukkaW closed this Jan 13, 2024
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