Skip to content

Commit

Permalink
polish: remove misleading comment
Browse files Browse the repository at this point in the history
We could not demonstrate via actual benchmarking that the tick reduction from awaiting a promise prior to returning it translates into real-world performance gains. See graphql#3796.

In any case, the promise must be awaited (irrespective of performance) to allow the catch block to handle rejection errors. Simply returning `completed` would result in test failures.
  • Loading branch information
yaacovCR committed Dec 27, 2022
1 parent 1bf71ee commit afd722e
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/execution/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -933,8 +933,6 @@ async function completePromisedValue(
asyncPayloadRecord,
);
if (isPromise(completed)) {
// see: https://github.com/tc39/proposal-faster-promise-adoption
// it is faster to await a promise prior to returning it from an async function
completed = await completed;
}
return completed;
Expand Down

0 comments on commit afd722e

Please sign in to comment.