Skip to content

async_hooks: remove promise object from resource

While it doesn't make any difference now. In the future PromiseHooks could be refactored to provide an asyncId instead of the promise object. That would make escape analysis on promises possible.

Escape analysis on promises could lead to a more efficient destroy hook, if provide by PromiseHooks as well. But at the very least would allow the destroy hook to be emitted earlier. The destroy hook not being emitted on promises frequent enough is a known and reported issue. See https://github.com/nodejs/node/issues/14446 and https://github.com/Jeff-Lewis/cls-hooked/issues/11.

While all this is speculation for now, it all depends on the promise object not being a part of the PromiseWrap resource object.

Ref: https://github.com/nodejs/node/issues/14446 Ref: https://github.com/nodejs/diagnostics/issues/188

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

/cc @nodejs/diagnostics @nodejs/v8

Merge request reports

Loading