Insightful post by Mathias Bynens:
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
Xcall to the callback chain. In the context of stack traces, this difference is pretty significant.
The gist is that when using
.then(), the JS engine needs to capture the stack trace for future use in case things go awry.
Capturing the stack trace takes time (i.e. degrades performance); storing these stack traces requires memory. 🐌👎
Sidenote: Need extra arguments to prefer