FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

lib: refactor transferable AbortSignal by jasnell · Pull Request #43388 · nodejs/node · GitHub

/ node Public

lib: refactor transferable AbortSignal - #43388

Closed
jasnell wants to merge 1 commit into
nodejs:mainfrom
jasnell:refactor-transferable-abortsignal
Closed

lib: refactor transferable AbortSignal#43388
jasnell wants to merge 1 commit into
nodejs:mainfrom
jasnell:refactor-transferable-abortsignal

Conversation

jasnell commented Jun 12, 2022
edited
Loading

Copy link
Copy Markdown
Member

The use of makeTransferable on all AbortSignal instances made creating them always slow,
causing bottlenecks in stuff like Web Streams. This refactors that so that AbortSignals
are not transferable by default, which is actually the correct standard behavior anyway.
A new transferableAbortSignal and transferableAbortController utility is provided to
enable the transferable use case.

Signed-off-by: James M Snell jasnell@gmail.com
Fixes: #43160

/cc @mcollina @ronag

The use of makeTransferable on all AbortSignal instances made creating them always slow,
causing bottlenecks in stuff like Web Streams. This refactors that so that AbortSignals
are not transferable by default, which is actually the correct standard behavior anyway.
A new transferableAbortSignal and transferableAbortController utility is provided to
enable the transferable use case.

Signed-off-by: James M Snell <jasnell@gmail.com>
nodejs-github-bot added needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. worker Issues and PRs related to Worker support. labels Jun 12, 2022

Copy link
Copy Markdown
Member

Note the failing tests

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

Copy link
Copy Markdown
Collaborator

Comment thread doc/api/util.md
<!--
added: REPLACEME
-->

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
> Stability: 1 - Experimental

Comment thread doc/api/util.md
<!--
added: REPLACEME
-->

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
> Stability: 1 - Experimental

* }} [init]
* @returns {AbortSignal}
*/
function createAbortSignal(init) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
function createAbortSignal(init) {
function createAbortSignal(init = kEmptyObject) {

and then requiring kEmptyObject from internal/util will probably fix the test failures. You might also want to rebase to include the change from #43159 for this to work.

jasnell commented Jul 30, 2022

Copy link
Copy Markdown
Member Author

Superseded by #44048

jasnell closed this Jul 30, 2022
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

Labels

needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. worker Issues and PRs related to Worker support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transferrable AbortController is very slow

6 participants


Back | FazBrowse Home | New Git URL