Title: buffer: optimize buffer.concat performance by mertcanaltin · Pull Request #61721 · nodejs/node · GitHub
Open Graph Title: buffer: optimize buffer.concat performance by mertcanaltin · Pull Request #61721 · nodejs/node
X Title: buffer: optimize buffer.concat performance by mertcanaltin · Pull Request #61721 · nodejs/node
Description: 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: ➜ node git:(mert/buffer-concat-optimize-js) ✗ node-benchmark-compare ./result.csv confidence improvement accuracy (*) (**) (***) buffers/buffer-concat-fill.js n=800000 extraSize=1 * 10.37 % ±9.47% ±13.37% ±19.13% buffers/buffer-concat-fill.js n=800000 extraSize=1024 2.91 % ±6.22% ±8.53% ±11.62% buffers/buffer-concat-fill.js n=800000 extraSize=256 * 7.05 % ±6.13% ±8.41% ±11.49% buffers/buffer-concat.js n=800000 withTotalLength=0 pieceSize=1 pieces=16 ** 1.76 % ±1.18% ±1.64% ±2.26% buffers/buffer-concat.js n=800000 withTotalLength=0 pieceSize=1 pieces=4 *** 5.20 % ±1.21% ±1.65% ±2.25% buffers/buffer-concat.js n=800000 withTotalLength=0 pieceSize=16 pieces=16 ** 1.96 % ±1.17% ±1.61% ±2.21% buffers/buffer-concat.js n=800000 withTotalLength=0 pieceSize=16 pieces=4 *** 3.06 % ±1.50% ±2.06% ±2.84% buffers/buffer-concat.js n=800000 withTotalLength=0 pieceSize=256 pieces=16 1.93 % ±8.35% ±11.48% ±15.73% buffers/buffer-concat.js n=800000 withTotalLength=0 pieceSize=256 pieces=4 2.37 % ±6.69% ±9.34% ±13.12% buffers/buffer-concat.js n=800000 withTotalLength=1 pieceSize=1 pieces=16 -0.59 % ±0.99% ±1.36% ±1.86% buffers/buffer-concat.js n=800000 withTotalLength=1 pieceSize=1 pieces=4 *** 5.17 % ±1.25% ±1.71% ±2.33% buffers/buffer-concat.js n=800000 withTotalLength=1 pieceSize=16 pieces=16 0.98 % ±1.45% ±2.02% ±2.81% buffers/buffer-concat.js n=800000 withTotalLength=1 pieceSize=16 pieces=4 *** 4.44 % ±1.89% ±2.62% ±3.62% buffers/buffer-concat.js n=800000 withTotalLength=1 pieceSize=256 pieces=16 * -1.97 % ±1.89% ±2.63% ±3.67% buffers/buffer-concat.js n=800000 withTotalLength=1 pieceSize=256 pieces=4 *** 3.55 % ±1.08% ±1.49% ±2.04% Be aware that when doing many comparisons the risk of a false-positive result increases. In this case, there are 15 comparisons, you can thus expect the following amount of false-positive results: 0.75 false positives, when considering a 5% risk acceptance (*, **, ***), 0.15 false positives, when considering a 1% risk acceptance (**, ***), 0.01 false positives, when considering a 0.1% risk acceptance (***) ➜ node git:(mert/buffer-concat-optimize-js) ✗
Open Graph Description: 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 Bu...
X Description: 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 Bu...
Opengraph URL: https://github.com/nodejs/node/pull/61721
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:cc11efdf-19e5-42f6-2de8-3c3cb93d49f5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8300:1A1F1B:4AEF4DD:68F5D85:6A4F8A75 |
| html-safe-nonce | 35c59ab534aed6c28455133ebb87f63287c66417f243910d8a8877f4ff98e69f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzAwOjFBMUYxQjo0QUVGNEREOjY4RjVEODU6NkE0RjhBNzUiLCJ2aXNpdG9yX2lkIjoiMjYzNTE2MDY1OTIxMDI0MjY3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ce1a9f19d7aed136a0785b09fd396adb6292f9ae5740025ede361ac6c972ca1f |
| hovercard-subject-tag | pull_request:3257929382 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/nodejs/node/pull/61721/files |
| twitter:image | https://avatars.githubusercontent.com/u/37827216?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/37827216?s=400&v=4 |
| og:image:alt | 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 Bu... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4b249b445842943ed31549e027f57a8ade9881ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width