dgram: restore buffer optimization in fixBufferList · nodejs/node@3a3220a · GitHub
Skip to content

Commit 3a3220a

Browse files
ri7116aduh95
authored andcommitted
dgram: restore buffer optimization in fixBufferList
Restore the Buffer.isBuffer() check to avoid unnecessary Buffer.from() calls when the input is already a Buffer. This improves performance by 30-50% for buffer-heavy UDP operations. Includes benchmark test for fixBufferList function to verify the performance improvements across different data types and chunk sizes. PR-URL: #59934 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent 5bf21a4 commit 3a3220a

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

benchmark/dgram/send-types.js

Lines changed: 52 additions & 0 deletions

lib/dgram.js

Lines changed: 2 additions & 0 deletions

0 commit comments

Comments
 (0)