Skip to content
Browse files

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: #30415
Reviewed-By: Matteo Collina <>
Reviewed-By: James M Snell <>
Reviewed-By: Gireesh Punathil <>
Reviewed-By: Denys Otrishko <>
Reviewed-By: Trivikram Kamat <>
  • Loading branch information
ryanj authored and MylesBorins committed Nov 12, 2019
1 parent e52237d commit 7d0631aefcbe2e862cda05a0689bba42b385ced7
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/internal/js_stream_socket.js
@@ -157,6 +157,7 @@ class JSStreamSocket extends Socket {
let pending = bufs.length;;
// Use `var` over `let` for performance optimization.
for (var i = 0; i < bufs.length; ++i)[i], done);;

0 comments on commit 7d0631a

Please sign in to comment.
You can’t perform that action at this time.