Asynchronous stack traces: why `await` beats `.then()` https://mathiasbynens.be/notes/async-stack-traces …
async/await is more than just syntax sugar over promises!
-
Show this thread
-
Replying to @mathias
I've left a comment, however I'm not sure if it was submitted. Could you please check? :)
1 reply 0 retweets 0 likes -
Replying to @kurtextrem @mathias
Ping again. Comment appended as screenshot:pic.twitter.com/ALspQys0pk
2 replies 0 retweets 0 likes -
Replying to @kurtextrem
Hmm, that question is unrelated to the optimization in the blog post. I can’t think of a significant perf diff in this particular case.
1 reply 0 retweets 1 like -
Replying to @mathias
So to say async > promises only if return value is not needed. Thank you!
1 reply 0 retweets 0 likes -
Replying to @kurtextrem
Huh? That does not follow. Also, the optimization in the article only applies to stack traces.
1 reply 0 retweets 0 likes -
Replying to @mathias
What I meant was, if you need the return value, it doesn't matter if you use await or .then; If you don't, stick with await :)
3 replies 0 retweets 0 likes
The only difference between your example and what’s in the post is the return value being used… But that doesn’t matter for the optimization
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.