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

lib: reduce overhead of `SafePromiseAllSettledReturnVoid` calls by aduh95 · Pull Request #51243 · nodejs/node · GitHub

/ node Public

lib: reduce overhead of SafePromiseAllSettledReturnVoid calls - #51243

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
aduh95:SafePromiseAllSettledReturnVoid
Dec 22, 2023
Merged

lib: reduce overhead of SafePromiseAllSettledReturnVoid calls#51243
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
aduh95:SafePromiseAllSettledReturnVoid

Conversation

aduh95 commented Dec 20, 2023

Copy link
Copy Markdown
Contributor

It was simply calling SafePromiseAllSettled, which itself calls arrayToSafePromiseIterable which wraps all promises into new SafePromise object and wraps it into a SafeArrayIterator. Since we don't care about the return value, we can take some shortcuts.

const arrayToSafePromiseIterable = (promises, mapFn) =>
new primordials.SafeArrayIterator(
ArrayPrototypeMap(
promises,
(promise, i) =>
new SafePromise((a, b) => PromisePrototypeThen(mapFn == null ? promise : mapFn(promise, i), a, b)),
),
);

It was simply calling `SafePromiseAllSettled`, which itself calls
`arrayToSafePromiseIterable` which wraps all promises into new
`SafePromise` object and wraps it into a `SafeArrayIterator`. Since we
don't care about the return value, we can take some shortcuts.
nodejs-github-bot added the needs-ci PRs that need a full CI run. label Dec 20, 2023
aduh95 added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Dec 21, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 21, 2023

Copy link
Copy Markdown
Collaborator

nodejs-github-bot commented Dec 21, 2023
edited by jasnell
Loading

Copy link
Copy Markdown
Collaborator

aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 21, 2023
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 22, 2023
nodejs-github-bot merged commit bc16952 into nodejs:main Dec 22, 2023

Copy link
Copy Markdown
Collaborator

Landed in bc16952

aduh95 deleted the SafePromiseAllSettledReturnVoid branch December 23, 2023 00:48
RafaelGSS pushed a commit that referenced this pull request Jan 2, 2024
It was simply calling `SafePromiseAllSettled`, which itself calls
`arrayToSafePromiseIterable` which wraps all promises into new
`SafePromise` object and wraps it into a `SafeArrayIterator`. Since we
don't care about the return value, we can take some shortcuts.

PR-URL: #51243
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: James M Snell <jasnell@gmail.com>
RafaelGSS mentioned this pull request Jan 2, 2024
richardlau pushed a commit that referenced this pull request Mar 25, 2024
It was simply calling `SafePromiseAllSettled`, which itself calls
`arrayToSafePromiseIterable` which wraps all promises into new
`SafePromise` object and wraps it into a `SafeArrayIterator`. Since we
don't care about the return value, we can take some shortcuts.

PR-URL: #51243
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau mentioned this pull request Mar 25, 2024
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

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL