{{ message }}
domain, src: clean up domain-related code#18291
Closed
apapirovski wants to merge 5 commits intonodejs:masterfrom
Closed
domain, src: clean up domain-related code#18291apapirovski wants to merge 5 commits intonodejs:masterfrom
apapirovski wants to merge 5 commits intonodejs:masterfrom
Conversation
Contributor
Author
Move the majority of C++ domain-related code into JS land by introducing a top level domain callback which handles entering & exiting the domain. Move the rest of the domain necessities into their own file that creates an internal binding, to avoid exposing domain-related code on the process object. Modify an existing test slightly to better test domain-related code.
3f37b75 to
c6cadb3
Compare
Contributor
Author
|
Fixed up. CI: https://ci.nodejs.org/job/node-test-pull-request/12658/ Linter failure is not from this PR... |
bnoordhuis
approved these changes
Jan 22, 2018
| argv_array->Set(env->context(), i, argv[i]).FromJust(); | ||
| } | ||
| Local<Value> domain_argv[] = { callback, argv_array }; | ||
| ret = domain_cb->Call(env->context(), recv, 2, domain_argv); |
Member
There was a problem hiding this comment.
It's probably faster to use spread in JS land and skip allocating the JS array here. I.e.:
std::vector<Local<Value>> args(1 + argc);
args[0] = callback;
std::copy(&argv[0], &argv[argc], &args[1]);
ret = domain_cb->Call(env->context(), recv, args.size(), &args[0]);Then in JS:
function topLevelDomainCallback(cb, ...args) {
// ...
}
Contributor
Author
|
CI: https://ci.nodejs.org/job/node-test-pull-request/12660/ Now that linter & inspector tests are fixed. |
bnoordhuis
approved these changes
Jan 22, 2018
addaleax
approved these changes
Jan 22, 2018
Contributor
Author
|
@AndreasMadsen I would love to have you review this, if possible, as you've headed up most of the effort around the recent changes to domains. Thanks! |
jasnell
approved these changes
Jan 26, 2018
apapirovski
added a commit
that referenced
this pull request
Jan 29, 2018
PR-URL: #18291 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
apapirovski
added a commit
that referenced
this pull request
Jan 29, 2018
PR-URL: #18291 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
apapirovski
added a commit
that referenced
this pull request
Jan 29, 2018
PR-URL: #18291 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
apapirovski
added a commit
that referenced
this pull request
Jan 29, 2018
Move the majority of C++ domain-related code into JS land by introducing a top level domain callback which handles entering & exiting the domain. Move the rest of the domain necessities into their own file that creates an internal binding, to avoid exposing domain-related code on the process object. Modify an existing test slightly to better test domain-related code. PR-URL: #18291 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Contributor
Author
7 tasks
2 tasks
Contributor
|
this doesn't land cleanly in v9.x, should it be backported? |
MylesBorins
pushed a commit
that referenced
this pull request
Feb 20, 2018
Move the majority of C++ domain-related code into JS land by introducing a top level domain callback which handles entering & exiting the domain. Move the rest of the domain necessities into their own file that creates an internal binding, to avoid exposing domain-related code on the process object. Modify an existing test slightly to better test domain-related code. PR-URL: #18291 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Feb 21, 2018
Move the majority of C++ domain-related code into JS land by introducing a top level domain callback which handles entering & exiting the domain. Move the rest of the domain necessities into their own file that creates an internal binding, to avoid exposing domain-related code on the process object. Modify an existing test slightly to better test domain-related code. PR-URL: #18291 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Feb 21, 2018
Move the majority of C++ domain-related code into JS land by introducing a top level domain callback which handles entering & exiting the domain. Move the rest of the domain necessities into their own file that creates an internal binding, to avoid exposing domain-related code on the process object. Modify an existing test slightly to better test domain-related code. PR-URL: #18291 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Merged
Contributor
|
Does this make sense for LTS? |
addaleax
pushed a commit
to addaleax/node
that referenced
this pull request
Feb 27, 2018
PR-URL: nodejs#18291 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Closed
Contributor
|
Should land with #18460 |
MayaLekova
pushed a commit
to MayaLekova/node
that referenced
this pull request
May 8, 2018
PR-URL: nodejs#18291 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
MayaLekova
pushed a commit
to MayaLekova/node
that referenced
this pull request
May 8, 2018
PR-URL: nodejs#18291 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
MayaLekova
pushed a commit
to MayaLekova/node
that referenced
this pull request
May 8, 2018
PR-URL: nodejs#18291 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
MayaLekova
pushed a commit
to MayaLekova/node
that referenced
this pull request
May 8, 2018
Move the majority of C++ domain-related code into JS land by introducing a top level domain callback which handles entering & exiting the domain. Move the rest of the domain necessities into their own file that creates an internal binding, to avoid exposing domain-related code on the process object. Modify an existing test slightly to better test domain-related code. PR-URL: nodejs#18291 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Move the majority of C++ domain-related code into JS land by introducing a top level domain callback which handles entering & exiting the domain.
Move the rest of the domain necessities into their own file that creates an internal binding, to avoid exposing domain-related code on the process object.
Also a bit of other assorted domain-related cleanup.
(This happens to boost the performance of top-level domain code by roughly 33% but mostly I just wanted to have less domain-related code scattered all over.)
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
domain, src