-
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
src: cache and resue isolate and contex pointers #23024
src: cache and resue isolate and contex pointers #23024
Conversation
Many places these values are obtained through `env` pointer that incurs function calls. Source in once and re-use as much as possible. There are more of this pattern in this file, but those are either one-time use or used in conditional blocks which means sourcing-in those data early may not be beneficial.
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.
@gireeshpunathil I’m not sure … the commit message makes it sound like this is about performance? These calls should all be essentially free in terms of runtime cost, so this is mostly a question of readability, and I’m not sure it’s worth the churn if the goal is to apply these kinds of changes everywhere…
In any case, this PR LGTM if you’re volunteering to backport this as soon as it lands :)
sure, thanks @addaleax . runtime cost was a consideration which I thought of it first, but your point makes sense to me now as these calls boils down to mere field accesses. |
Landed in ea3bb9a. |
Many places these values are obtained through `env` pointer that incurs function calls. Source in once and re-use as much as possible. There are more of this pattern in this file, but those are either one-time use or used in conditional blocks which means sourcing-in those data early may not be beneficial. PR-URL: #23024 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]>
Many places these values are obtained through `env` pointer that incurs function calls. Source in once and re-use as much as possible. There are more of this pattern in this file, but those are either one-time use or used in conditional blocks which means sourcing-in those data early may not be beneficial. PR-URL: #23024 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]>
Many places these values are obtained through
env
pointer that incurs function calls. Source in once and re-use as much as possible. There are more of this pattern in this file, but those are eitherone-time use or used in conditional blocks which means sourcing-in those data early may not be beneficial.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes