Async/Generator functions in CLJS - (requesting feedback!)


Maybe I’m reading the post wrong, but what they say is they’ve improved the performance of Promises. And the charts actually even show that Promises are even faster then async/await.


I said “in the future”. Right now Promise code performs better. The coming improvements are mentioned later on in the post.

async / await outperforms hand-written promise code now . The key takeaway here is that we significantly reduced the overhead of async functions — not just in V8, but across all JavaScript engines, by patching the spec


Interesting. I’m not sure what makes it faster then hand written Promises. Unless they mean non optimal hand written Promises.


The article @thheller posted in August explains one reason why. The gist of it is:

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.