Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is async await more performance demanding than normal Promises? [duplicate]

I have a fairly big project in node.js version 7. I am planning to switch to node 8.9 LTS and replace Promise callbacks with async await. The project demands high performance machines and there are lots of high memory consuming operations. So the question is, will using `async await drop the project's performance ?

I do not have enough time to actually upgrade node and promises to async await and compare the refactored code with the previous version of the project. So any information about performance drops or rises while switching from promise to async await will be helpful

like image 574
Prasanna Avatar asked Dec 09 '25 17:12

Prasanna


1 Answers

Javascript will interpret the async/await syntax just like a normal Promise callback from the computers point of view. Javascript will handle it the same way as a normal Promise callback.

Therefor there should be no performance differences between the two. It's basically just helps make your code cleaner and easier to read and understand. But no fundemntal differences between the two.

like image 122
Charlie Fish Avatar answered Dec 11 '25 07:12

Charlie Fish



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!