Commit 4a8ea63b authored by Matt Loring's avatar Matt Loring Committed by James M Snell
Browse files

async_wrap,src: wrap promises directly

Promises do not have any internal fields by default. V8 recently added
the capability of configuring the number of internal fields on promises.
This change adds an internal field to promises allowing promises to be
wrapped directly by the PromiseWrap object. In addition to cleaner code
this avoids an extra object allocation per promise and speeds up promise
creation with async_hooks enabled by ~2x.

PR-URL: https://github.com/nodejs/node/pull/13242
Ref: https://github.com/nodejs/node/pull/13224


Reviewed-By: default avatarAndreas Madsen <amwebdk@gmail.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
parent 0be029ec
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment