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

src: cache and resue isolate and contex pointers #23024

Closed

Conversation

gireeshpunathil
Copy link
Member

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.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

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.
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. labels Sep 22, 2018
Copy link
Member

@addaleax addaleax left a 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 :)

@gireeshpunathil
Copy link
Member Author

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.

@addaleax
Copy link
Member

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 23, 2018
@danbev
Copy link
Contributor

danbev commented Sep 25, 2018

Landed in ea3bb9a.

@danbev danbev closed this Sep 25, 2018
danbev pushed a commit that referenced this pull request Sep 25, 2018
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 <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
targos pushed a commit that referenced this pull request Sep 25, 2018
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 <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants