Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(979)

Issue 2028253004: Promises: Short circuit promise resolution procedure (Closed)

Created:
4 years, 6 months ago by gsathya
Modified:
4 years, 6 months ago
Reviewers:
Dan Ehrenberg, adamk
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Promises: Short circuit promise resolution procedure When |ResolvePromise| is resolved with a promise that is already fulfilled or resolved, we can short circuit the promise resolution procedure by directly looking up the result from the promise. We save creating two closures, enqueuing in the promise queue, and running through PromiseThen. This patch uses IsPromise to check if the |resolution| object is a native promise and also checks if |resolution.then| hasn't been monkey patched. This patch adds some redundant code from PromiseThen like setting the promiseHasHandlerSymbol and calling PromiseRevokeReject call, which would've been taken care of by PromiseThen in the old code path. This patch results in a 13.8% improvement(over 5 runs) in the bluebird benchmarks. BUG=v8:5046 Committed: https://crrev.com/41c875a69e69aeea0c1599d4eb8bf0d03784faac Cr-Commit-Position: refs/heads/master@{#36765}

Patch Set 1 #

Patch Set 2 : fix tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -0 lines) Patch
M src/js/promise.js View 1 1 chunk +27 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (9 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2028253004/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2028253004/20001
4 years, 6 months ago (2016-06-03 05:14:10 UTC) #3
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-03 05:56:36 UTC) #5
gsathya
4 years, 6 months ago (2016-06-03 05:58:11 UTC) #9
Dan Ehrenberg
lgtm Seems correct because nothing could've happened in those future microtask queue items except call ...
4 years, 6 months ago (2016-06-03 13:43:41 UTC) #10
adamk
lgtm, though I think we should be careful about over-fitting to this benchmark (agree with ...
4 years, 6 months ago (2016-06-03 23:31:48 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2028253004/20001
4 years, 6 months ago (2016-06-06 21:12:21 UTC) #13
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 6 months ago (2016-06-06 21:37:31 UTC) #15
commit-bot: I haz the power
4 years, 6 months ago (2016-06-06 21:38:50 UTC) #17
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/41c875a69e69aeea0c1599d4eb8bf0d03784faac
Cr-Commit-Position: refs/heads/master@{#36765}

Powered by Google App Engine
This is Rietveld 408576698