-
Notifications
You must be signed in to change notification settings - Fork 64
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 native Buffer whenever available #1032
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27f2641
to
11259ac
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1032 +/- ##
========================================
Coverage 52.77% 52.77%
========================================
Files 12 12
Lines 612 612
Branches 146 146
========================================
Hits 323 323
Misses 249 249
Partials 40 40
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
1b10a07
to
bff7c31
Compare
bff7c31
to
37ed816
Compare
fbb9162
to
53e744c
Compare
codenirvana
approved these changes
Feb 21, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context and fix:
Use the native Buffer when available. This is done to get better performance and system stability when operating on large buffers
For example, when converting a large buffer to a string, the native Buffer is much faster than the isomorphic buffer. It supports toString() operation on buffers of size up to 512MB, while the isomorphic buffer errors out after 100MB.
Additional Changes
Performance benchmarking results for
toString()
(Node):NOTE : On develop + Node v20 and below, the process crashes for size greater than ~120MB. For v22 we get "invalid array length" error (maked by
undefined
in the results below)Script for benchmarking
Node v16
develop
This branch
Node v18
develop
This branch
Node v20
develop
This branch
Node v22
develop
This branch