diff options
author | ryan jarvinen <ryan.jarvinen@gmail.com> | 2019-11-12 18:13:48 +0300 |
---|---|---|
committer | Gireesh Punathil <gpunathi@in.ibm.com> | 2019-11-26 10:40:43 +0300 |
commit | 79e86ac5fd9e1fdc44493af2155bb823cea7b41f (patch) | |
tree | a17868cb5c3e2726a62e5ba318effb2761d26b11 /lib/internal/js_stream_socket.js | |
parent | a6fd2828c61e866e2cdda4ff783ea25dd582ac3d (diff) |
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>
Diffstat (limited to 'lib/internal/js_stream_socket.js')
-rw-r--r-- | lib/internal/js_stream_socket.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/internal/js_stream_socket.js b/lib/internal/js_stream_socket.js index ebe90cccc75..cdf6cd7ac7e 100644 --- a/lib/internal/js_stream_socket.js +++ b/lib/internal/js_stream_socket.js @@ -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(); |