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

fix: do not copy data before sending over datachannel #336

Merged
merged 1 commit into from
Mar 1, 2025

Conversation

achingbrain
Copy link
Contributor

@achingbrain achingbrain commented Feb 26, 2025

The single-arg constructor of Uint8Array copies the data from the passed arraylike.

This can impact streaming performance in high traffic environments.

Instead you can use the three-arg constructor or just pass the Uint8Array through if the arg satisfies that type.

Verified

This commit was signed with the committer’s verified signature.
achingbrain Alex Potsides
The single-arg constructor of `Uint8Array` copies the data from the
passed arraylike.

This can impact streaming performance in high traffic environments.

Instead you can use the three-arg constructor or just pass the
Uint8Array through if the arg satisfies that type.
@achingbrain achingbrain force-pushed the fix/skip-copy-on-send branch from 1b05cc6 to daba56f Compare February 26, 2025 18:27
@murat-dogan
Copy link
Owner

Seems good. Thanks.

@murat-dogan murat-dogan merged commit 5f89833 into murat-dogan:master Mar 1, 2025
1 check passed
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