| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
This patch: - Refactors the Console constructor: moves the property binding code into and the writable streams binding code into two methods defined on the Console.prototype with symbols. - Refactors the global console creation: we only need to share the property binding code from the Console constructor. To bind the streams we can lazy load `process.stdio` and `process.stderr` so that we don't create these streams when they are not used. This significantly reduces the number of modules loaded during bootstrap. Also, by calling the refactored-out method directly we can skip the unnecessary typechecks when creating the global console and there is no need to create a temporary Console anymore. - Refactors the error handler creation and the `write` method: use a `kUseStdout` symbol to tell the internals which stream should be loaded from the console instance. Also put the `write` method on the Console prototype so it just loads other properties directly off the console instance which simplifies the call sites. Also leaves a few TODOs for further refactoring of the console bootstrap.
|
@joyeecheung sadly an error occured when I tried to trigger a build :( |
Sorry, something went wrong.
|
CI: https://ci.nodejs.org/job/node-test-pull-request/18827/ cc @nodejs/process |
Sorry, something went wrong.
|
CITGM on master: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1639/ cc @SimenB |
Sorry, something went wrong.
| const assert = require('assert'); | ||
|
|
||
| assert(list.length <= 78, list); | ||
| assert(list.length <= 56, list); |
There was a problem hiding this comment.
😅
Sorry, something went wrong.
| @@ -1,2 +1,2 @@ | |||
| calling stdout._refreshSize | |||
There was a problem hiding this comment.
The order changed here because in the test test-stderr-stdout-handle-sigwinch, process.stderr is accessed before process.stdout so the SIGWINCH even listeners are attached in this order. I don't think the order by which we refresh the size the two streams makes a difference, though.
Sorry, something went wrong.
|
BTW I think this somewhat eliminates #17058 (comment) (at least for non-workers), since these are now gone from the process.moduleLoadList computed right after bootstrap: Binding tty_wrap, Binding stream_wrap, Binding tcp_wrap, Binding pipe_wrap |
Sorry, something went wrong.
| // to eliminate the noise introduced by --experimental-worker | ||
| const { internalBinding } = require('internal/test/binding'); | ||
| const { threadId } = internalBinding('worker'); | ||
| const isMainThread = threadId === 0; |
There was a problem hiding this comment.
common.isMainThread?
Sorry, something went wrong.
There was a problem hiding this comment.
@richardlau Didn't know about this, thanks!
Sorry, something went wrong.
|
Fixed the test for the worker CI - they need to use the streams to communicate with main thread anyways so still need to load 78 modules after bootstrap. @richardlau Thanks for the suggestion, updated. |
Sorry, something went wrong.
|
I plan to land this after the CI is unlocked and have another fresh CI run. |
Sorry, something went wrong.
Sorry, something went wrong.
This patch: - Refactors the Console constructor: moves the property binding code into and the writable streams binding code into two methods defined on the Console.prototype with symbols. - Refactors the global console creation: we only need to share the property binding code from the Console constructor. To bind the streams we can lazy load `process.stdio` and `process.stderr` so that we don't create these streams when they are not used. This significantly reduces the number of modules loaded during bootstrap. Also, by calling the refactored-out method directly we can skip the unnecessary typechecks when creating the global console and there is no need to create a temporary Console anymore. - Refactors the error handler creation and the `write` method: use a `kUseStdout` symbol to tell the internals which stream should be loaded from the console instance. Also put the `write` method on the Console prototype so it just loads other properties directly off the console instance which simplifies the call sites. Also leaves a few TODOs for further refactoring of the console bootstrap. PR-URL: #24534 Reviewed-By: Gus Caplan <me@gus.host>
|
This does not land cleanly on 11.x. Please open a backport or add a label if this should not be backported. |
Sorry, something went wrong.
|
@joyeecheung would you like to backport this PR to 11.x? It seems critical if we want to keep the branch up to date with all other subsequent refactorings that happened on master. |
Sorry, something went wrong.
|
@joyeecheung that would be awesome. It would help a lot of the non breaking changes could be backported. It's getting pretty hard to prepare a release at the moment due to many conflicts. |
Sorry, something went wrong.
|
#24047 needs to be backported together as well |
Sorry, something went wrong.
This patch: - Refactors the Console constructor: moves the property binding code into and the writable streams binding code into two methods defined on the Console.prototype with symbols. - Refactors the global console creation: we only need to share the property binding code from the Console constructor. To bind the streams we can lazy load `process.stdio` and `process.stderr` so that we don't create these streams when they are not used. This significantly reduces the number of modules loaded during bootstrap. Also, by calling the refactored-out method directly we can skip the unnecessary typechecks when creating the global console and there is no need to create a temporary Console anymore. - Refactors the error handler creation and the `write` method: use a `kUseStdout` symbol to tell the internals which stream should be loaded from the console instance. Also put the `write` method on the Console prototype so it just loads other properties directly off the console instance which simplifies the call sites. Also leaves a few TODOs for further refactoring of the console bootstrap. PR-URL: nodejs#24534 Reviewed-By: Gus Caplan <me@gus.host>
This patch: - Refactors the Console constructor: moves the property binding code into and the writable streams binding code into two methods defined on the Console.prototype with symbols. - Refactors the global console creation: we only need to share the property binding code from the Console constructor. To bind the streams we can lazy load `process.stdio` and `process.stderr` so that we don't create these streams when they are not used. This significantly reduces the number of modules loaded during bootstrap. Also, by calling the refactored-out method directly we can skip the unnecessary typechecks when creating the global console and there is no need to create a temporary Console anymore. - Refactors the error handler creation and the `write` method: use a `kUseStdout` symbol to tell the internals which stream should be loaded from the console instance. Also put the `write` method on the Console prototype so it just loads other properties directly off the console instance which simplifies the call sites. Also leaves a few TODOs for further refactoring of the console bootstrap. PR-URL: #24534 Reviewed-By: Gus Caplan <me@gus.host>
This patch: - Refactors the Console constructor: moves the property binding code into and the writable streams binding code into two methods defined on the Console.prototype with symbols. - Refactors the global console creation: we only need to share the property binding code from the Console constructor. To bind the streams we can lazy load `process.stdio` and `process.stderr` so that we don't create these streams when they are not used. This significantly reduces the number of modules loaded during bootstrap. Also, by calling the refactored-out method directly we can skip the unnecessary typechecks when creating the global console and there is no need to create a temporary Console anymore. - Refactors the error handler creation and the `write` method: use a `kUseStdout` symbol to tell the internals which stream should be loaded from the console instance. Also put the `write` method on the Console prototype so it just loads other properties directly off the console instance which simplifies the call sites. Also leaves a few TODOs for further refactoring of the console bootstrap. PR-URL: nodejs#24534 Reviewed-By: Gus Caplan <me@gus.host>
This patch: - Refactors the Console constructor: moves the property binding code into and the writable streams binding code into two methods defined on the Console.prototype with symbols. - Refactors the global console creation: we only need to share the property binding code from the Console constructor. To bind the streams we can lazy load `process.stdio` and `process.stderr` so that we don't create these streams when they are not used. This significantly reduces the number of modules loaded during bootstrap. Also, by calling the refactored-out method directly we can skip the unnecessary typechecks when creating the global console and there is no need to create a temporary Console anymore. - Refactors the error handler creation and the `write` method: use a `kUseStdout` symbol to tell the internals which stream should be loaded from the console instance. Also put the `write` method on the Console prototype so it just loads other properties directly off the console instance which simplifies the call sites. Also leaves a few TODOs for further refactoring of the console bootstrap. PR-URL: nodejs#24534 Reviewed-By: Gus Caplan <me@gus.host>
| Back | FazBrowse Home | New Git URL |
This patch:
and the writable streams binding code into two methods defined
on the Console.prototype with symbols.
property binding code from the Console constructor. To bind the
streams we can lazy load process.stdio and process.stderr
so that we don't create these streams when they are not used.
This significantly reduces the number of modules loaded during
bootstrap. Also, by calling the refactored-out method directly
we can skip the unnecessary typechecks when creating the global
console and there is no need to create a temporary Console
anymore.
use a kUseStdout symbol to tell the internals which stream
should be loaded from the console instance. Also put the
write method on the Console prototype so it just loads
other properties directly off the console instance which simplifies
the call sites.
Also leaves a few TODOs for further refactoring of the console
bootstrap.
Local benchmark results
Checklist