mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
lib: adding perf notes js_stream_socket.js
Leaving var in place of let for performance optimization in short loops in hot paths. Added comments explaining why. PR-URL: https://github.com/nodejs/node/pull/30415 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
committed by
Gireesh Punathil
parent
a6fd2828c6
commit
79e86ac5fd
@@ -157,6 +157,7 @@ class JSStreamSocket extends Socket {
|
||||
let pending = bufs.length;
|
||||
|
||||
this.stream.cork();
|
||||
// Use `var` over `let` for performance optimization.
|
||||
for (var i = 0; i < bufs.length; ++i)
|
||||
this.stream.write(bufs[i], done);
|
||||
this.stream.uncork();
|
||||
|
||||
Reference in New Issue
Block a user