-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
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)