I've ported a few old fashioned callback code bases to async/await +
Promises in the last year or so.

When doing performance analysis and profiling I've noticed a significant
negative impact of Promise / async / await in that it adds micro tasks to
the queue.

Previously there was a different link between the libuv syscall that my
program made in node.js and the actual code being run in my application
since callbacks are called synchronously and there is no micro task queue.

With the async / await version of the codebase profiling is proving very
challenging because the stack traces all start in the micro task queue.

Would it be possible with some kind of flag or opt in mechanism to have
async / await use `global.Promise` instead of the builtin native promise ?

This would allow me to overwrite `global.Promise` with a non-compliant
version that has no micro task queue and invokes all the callbacks
synchronously. This would greatly aid with profiling and stack traces.

Thank you,
Jake.
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to