-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib: adding optemisation notes, leaving var
in place in js_stream_socket.js
#30415
Conversation
var
in place for nowvar
in place in js_stream_socket.js
8b2faa6
to
ec6ad97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with suggestion posted by mscdex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ec6ad97
to
82689aa
Compare
lib/internal/js_stream_socket.js
Outdated
@@ -157,6 +157,7 @@ class JSStreamSocket extends Socket { | |||
let pending = bufs.length; | |||
|
|||
this.stream.cork(); | |||
// Prefer `var` over `let` for performance optimization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit:
// Prefer `var` over `let` for performance optimization | |
// Prefer `var` over `let` for performance optimization. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @lundibundi. fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reworded, as build results warned: Line should be <= 72 columns
82689aa
to
296adc4
Compare
Leaving var in place of let for performance optimization in short loops in hot paths. Added comments explaining why.
296adc4
to
0c2391b
Compare
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>
landed in 79e86ac. thanks for the contribution! |
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>
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>
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>
CC @mcollina. Adding comments to explain why
var
is preferred overlet
in this loopChecklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesDeveloper's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.