There is no such relationship that you think you have, that is language mechanism to work with asynchronous execution, it knows nothing where it is running this, if it is back or front end.
Contrary to popular belief use async
It’s slower than not using. What’s different about it is not blocking the execution and it can give a better user experience, but don’t expect it to be faster just to give the impression of delivering something without preventing other parts of the application from working, its effort is greater than a synchronous execution.
If the execution is too fast async
will certainly make your application worse, if it takes too long to respond (they say at least 50ms waiting), and this only serves for IO operations, so it can give a better experience. If it was useful for everything it would be async
. Even when they have something async
in many cases it is better to use the same synchronous version. You have to test and see if it has advantage.
If you use it wrong, and a lot of people use it wrong, it can get worse in any situation. If you do it wrong, it’s no use testing.
You can start studying the subject at What are Async Methods?. But don’t stop there (mainly follow the links, see the documentation, just be careful because some example has techniques to make wait on purpose, do not copy the code as if it were cake recipe), it is something that needs a lot of understanding before using.
How is there a difference in performance? Async/await has a purpose that is to wait (or not) asynchronous actions. Try to contextualize these questions...
– Felipe Avelar
@Felipeavelar I think it now makes more sense, thanks for the comment.
– Samuel Renan Gonçalves Vaz