Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ffe3040

Browse filesBrowse files
ryanjaddaleax
authored andcommitted
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 <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>
1 parent 97e6273 commit ffe3040
Copy full SHA for ffe3040

File tree

Expand file treeCollapse file tree

1 file changed

+1
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-0
lines changed
Open diff view settings
Collapse file

‎lib/internal/js_stream_socket.js‎

Copy file name to clipboardExpand all lines: lib/internal/js_stream_socket.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ class JSStreamSocket extends Socket {
157157
let pending = bufs.length;
158158

159159
this.stream.cork();
160+
// Use `var` over `let` for performance optimization.
160161
for (var i = 0; i < bufs.length; ++i)
161162
this.stream.write(bufs[i], done);
162163
this.stream.uncork();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.