Bug 302151

Summary: [JSC] Add new internal microtask `PromiseFirstResolveWithoutHandlerJob` for `Promise.race`
Product: WebKit Reporter: Sosuke Suzuki <aosukeke>
Component: JavaScriptCoreAssignee: 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
Reported 2025-11-07 03:28:04 PST
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
Sosuke Suzuki
Comment 1 2025-11-07 03:31:05 PST
EWS
Comment 2 2025-11-11 22:04:40 PST
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
Comment 3 2025-11-11 22:05:13 PST
Note You need to log in before you can comment on or make changes to this bug.