Asynchronous stack traces: why await beats .then()
On his blog Mathias Bynens explains the differences under the hood between async/await and vanilla promises.
The fundamental difference between await and vanilla promises is that await X() suspends execution of the current function, while promise.then(X) continues execution of the current function after adding the X call to the callback chain. In the context of stack traces, this difference is pretty significant. ... Enable JavaScript engines to handle stack traces in a more performant and memory-efficient manner by following these recommendations:
- Prefer async/await over desugared promises.
- Use babel-preset-env to avoid transpiling async/await unnecessarily. ...
What are your thoughts on "Asynchronous stack traces: why await beats .then()"?