简体   繁体   English

不使用等待异步的性能问题 function

[英]Performance issues without using await for a async function

I'm using nodejs for one of my server applications.我将 nodejs 用于我的一个服务器应用程序。 But I found out there's some latency while running my app and I found that I didn't use await for a async function.但是我发现在运行我的应用程序时存在一些延迟,并且我发现我没有将 await 用于异步 function。 Is there any performance issues while not using await for a async function?不使用 await 异步 function 时是否存在任何性能问题?

The async-await is used to simplify the complexities created by nested callbacks. async-await 用于简化嵌套回调创建的复杂性。 So, both async-await and callback patterns serialize asynchronous processes.因此,async-await 和回调模式都将异步进程序列化。

This means that one process fires after the completion of another and, this could be experienced as a latency depending on the application.这意味着一个进程在另一个进程完成后触发,这可能会被视为延迟,具体取决于应用程序。

So, NO - async-await does not create any latency in its own right.所以, NO - async-await 本身不会产生任何延迟。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM