Hi, this idea is useful in some ways. When I'm migrating an AngularJS
app from $q (a Promise impl) to native async syntax, I got this
problem too. But I think this is not the right place to add a "flag"
in ES. You may want to suggest V8 or other JS engine to add a flag for
it.

On Sun, Apr 26, 2020 at 8:00 PM <[email protected]> wrote:
>
> Send es-discuss mailing list submissions to
>         [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mail.mozilla.org/listinfo/es-discuss
> or, via email, send a message with subject or body 'help' to
>         [email protected]
>
> You can reach the person managing the list at
>         [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of es-discuss digest..."
> Today's Topics:
>
>    1. Allow for async/await to use global.Promise and not builtin
>       Promise (Jake Verbaten)
>
>
>
> ---------- Forwarded message ----------
> From: Jake Verbaten <[email protected]>
> To: es-discuss <[email protected]>
> Cc:
> Bcc:
> Date: Sun, 26 Apr 2020 10:38:35 +0200
> Subject: Allow for async/await to use global.Promise and not builtin Promise
> 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
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to