lib: optimize writable stream buffer clearing · nodejs/node@d22d2fa · GitHub
Skip to content

Commit d22d2fa

Browse files
ri7116aduh95
authored andcommitted
lib: optimize writable stream buffer clearing
Improved the `clearBuffer` function by replacing `buffered.splice` with `ArrayPrototypeSlice`. - Eliminates O(N) shifting overhead. - Improves CPU utilization and reduces GC overhead. PR-URL: #59406 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 8e2076a commit d22d2fa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/internal/streams/writable.js

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)