Skip to content

[3.x] Fast forward resolved/rejected promises with await - #22

Closed
WyriHaximus wants to merge 1 commit into
reactphp:3.xfrom
WyriHaximus-labs:3.x--fastforward-resolved-promise
Closed

[3.x] Fast forward resolved/rejected promises with await#22
WyriHaximus wants to merge 1 commit into
reactphp:3.xfrom
WyriHaximus-labs:3.x--fastforward-resolved-promise

Conversation

@WyriHaximus

Copy link
Copy Markdown
Member

This makes awaiting an already resolved promise significantly faster.

Ported from: #18

@WyriHaximusWyriHaximus added this to the v3.0.0 milestone Jan 10, 2022
@WyriHaximus
WyriHaximus requested review from clue and jsorJanuary 10, 2022 07:47
@WyriHaximus
WyriHaximusforce-pushed the 3.x--fastforward-resolved-promise branch from b67fea3 to cd54e6dCompareJanuary 17, 2022 13:11
Comment threadsrc/functions.php
@WyriHaximus
WyriHaximusforce-pushed the 3.x--fastforward-resolved-promise branch 2 times, most recently from 584e5b0 to aa33246CompareJanuary 25, 2022 16:02
@WyriHaximus
WyriHaximusforce-pushed the 3.x--fastforward-resolved-promise branch 3 times, most recently from 67d87b0 to b9e36aaCompareFebruary 11, 2022 17:57
Comment threadsrc/functions.php
This makes `await`ing an already resolved promise significantly faster.
Ported from: reactphp#18
@WyriHaximus

Copy link
Copy Markdown
MemberAuthor

After discussing this PR with @SimonFrings and @clue we came to the conclusion that porting #18 to #21 and this PR doesn't introduce only more code and no performance gainst at all. We got a bit excited about the idea of doing this without realizing this makes the function more complex while the loop would instantly be stopped anyway. And that fraction of a millisecond gain we might get from doing this is not worth it. It was however very much worth doing this for fibers in #18.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@WyriHaximus@clue