-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
readline: remove the caching variable #14275
Conversation
line 486 and 525 contain for loops where a length property is cached in a variable (for example, itemLen). This used to be a performance optimization, but current V8 handles the optimization internally. these caching variables are removed, and using the length property directly instead.
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 if CI is green
cc/ @nodejs/performance @Trott do you have a reference for this? Otherwise I guess we might need a benchmark run. |
These changes are not supposed to have any performance impact whatsoever - if anything - caching the length manually slows loops down. Changes LGTM |
@gibfahn reference - if you'd like a reference to avoid a benchmark run - |
Seems pretty authoritative, thanks! |
|
CI was green, but I canceled some of the slower ARM hosts and one of the two FreeBSD hosts in order to help with our CI backlog problem. IMO, the CI for this can be treated as green. |
Landed in 97c4033, thank you for your first contribution! 🎉 |
Line 486 and 525 contain for loops where a length property is cached in a variable (for example, itemLen). This used to be a performance optimization, but current V8 handles the optimization internally. These caching variables are removed, and the length property is used directly instead. PR-URL: #14275 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Line 486 and 525 contain for loops where a length property is cached in a variable (for example, itemLen). This used to be a performance optimization, but current V8 handles the optimization internally. These caching variables are removed, and the length property is used directly instead. PR-URL: #14275 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Line 486 and 525 contain for loops where a length property is cached in a variable (for example, itemLen). This used to be a performance optimization, but current V8 handles the optimization internally. These caching variables are removed, and the length property is used directly instead. PR-URL: #14275 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
holding off on this optimization for v6.x, lmk if we should reconsider |
line 486 and 525 contain for loops where a length property
is cached in a variable (for example, itemLen). This used
to be a performance optimization, but current V8 handles
the optimization internally.
these caching variables are removed, and using the length
property directly instead.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)