Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

@ryanj
Copy link
Contributor

ryanj commented Nov 12, 2019

CC @mcollina. Adding comments to explain why var is preferred over let in this loop

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Developer'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.

@ryanj ryanj changed the title Adding optemisation notes, leaving `var` in place for now lib: adding optemisation notes, leaving `var` in place in js_stream_socket.js Nov 12, 2019
@ryanj ryanj force-pushed the ryanj:replace-var-with-let-nceu19 branch from 8b2faa6 to ec6ad97 Nov 12, 2019
Copy link
Member

trivikr left a comment

LGTM with suggestion posted by mscdex

@trivikr trivikr mentioned this pull request Nov 13, 2019
2 of 2 tasks complete
Copy link
Member

mcollina left a comment

LGTM

@ryanj ryanj force-pushed the ryanj:replace-var-with-let-nceu19 branch from ec6ad97 to 82689aa Nov 24, 2019
@nodejs-github-bot

This comment has been minimized.

@@ -157,6 +157,7 @@ class JSStreamSocket extends Socket {
let pending = bufs.length;

this.stream.cork();
// Prefer `var` over `let` for performance optimization

This comment has been minimized.

Copy link
@lundibundi

lundibundi Nov 24, 2019

Member

Small nit:

Suggested change
// Prefer `var` over `let` for performance optimization
// Prefer `var` over `let` for performance optimization.

This comment has been minimized.

Copy link
@ryanj

ryanj Nov 26, 2019

Author Contributor

thanks @lundibundi. fixed

This comment has been minimized.

Copy link
@ryanj

ryanj Nov 26, 2019

Author Contributor

reworded, as build results warned: Line should be <= 72 columns

@ryanj ryanj force-pushed the ryanj:replace-var-with-let-nceu19 branch from 82689aa to 296adc4 Nov 26, 2019
Leaving var in place of let for performance optimization in short loops in hot paths. Added comments explaining why.
@ryanj ryanj force-pushed the ryanj:replace-var-with-let-nceu19 branch from 296adc4 to 0c2391b Nov 26, 2019
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

gireeshpunathil added a commit that referenced this pull request Nov 26, 2019
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>
@gireeshpunathil

This comment has been minimized.

Copy link
Member

gireeshpunathil commented Nov 26, 2019

landed in 79e86ac.

thanks for the contribution!

addaleax added a commit that referenced this pull request Nov 30, 2019
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>
targos added a commit that referenced this pull request Dec 1, 2019
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>
@BridgeAR BridgeAR mentioned this pull request Dec 3, 2019
@BethGriggs BethGriggs mentioned this pull request Dec 9, 2019
MylesBorins added a commit that referenced this pull request Dec 17, 2019
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>
@BethGriggs BethGriggs mentioned this pull request Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.