-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
buffer: optimize buffer.concat performance #61721
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
base: main
Are you sure you want to change the base?
buffer: optimize buffer.concat performance #61721
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #61721 +/- ##
==========================================
+ Coverage 89.73% 89.74% +0.01%
==========================================
Files 675 675
Lines 204502 204673 +171
Branches 39304 39329 +25
==========================================
+ Hits 183502 183684 +182
+ Misses 13283 13281 -2
+ Partials 7717 7708 -9
🚀 New features to boost your workflow:
|
ChALkeR
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #60399 (comment)
Shouldn't _copyActual be just using TypedArrayPrototypeSet since #60399?
cc @gurgunday
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I updated bench result: #61721 (comment) |
gurgunday
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Removed the _copyActual indirection in the copy loop and called TypedArrayPrototypeSet directly.
Split auto-length and explicit-length paths so the auto-length copy loop is branch free. Replaced Buffer.allocUnsafe with allocate to skip redundant validation.
benchmark results: