Bug 302151
| Summary: | [JSC] Add new internal microtask `PromiseFirstResolveWithoutHandlerJob` for `Promise.race` | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Sosuke Suzuki <aosukeke> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Sosuke Suzuki
This patch adds a new internal microtask, `PromiseFirstResolveWithoutHandlerJob`.
It is very similar to the existing `PromiseResolveWithoutHandlerJob`, but differs
in that it returns early without doing anything if the target promise is already
fulfilled.
This reduces unnecessary function allocations in the fast path of `Promise.race`.
TipOfTree Patched
promise-race 7.8267+-0.4656 ^ 5.6479+-0.1740 ^ definitely 1.3858x faster
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Sosuke Suzuki
Pull request: https://github.com/WebKit/WebKit/pull/53583
EWS
Committed 302896@main (ad5c326d7845): <https://commits.webkit.org/302896@main>
Reviewed commits have been landed. Closing PR #53583 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/164536735>