Editorials

Do We Need Async Everywhere?

Recently I have been working on optimizing API calls to squeeze out as much performance as I can get. I’ve come to open the question regarding the use of Asynchronous calls for everything. There is some overhead associated with utilizing Async methods. You can actually measure the difference in your API performance when your method calls are very fast to start with. I have some methods that execute in less than 50ms. Removing the Async calls cuts the performance y 5ms, or 10 percent.
Let me clarify a bit to help it make more sense. A single Asych call does not at 10 percent overhead. In the method I was working on there were probably five Asynch calls executed through the different layers that were being executed, in order for the outer call to be Asynch from end to end. Once the client reached the Web API Asynch method, it then called  an Asynch proxy method, which called an Asynch ORM database method, which called an Asynch query method, returning the results to the API controller, which then called an Asych mapping method.
I decided to do a comparison and simply removed two of the Asynch calls and was able to reduce the load by 10 percent. So, I ask myself the question, do we always need to use Asynch in our method calls? It can make sense to use Asynch when the work can be broken up. But, if the execution is being performed on a system with a limited number of cores, are you really breaking things up? As your concurrent user base grows, are you really getting separate cores for your work?
As I recall, the primary goal of Asynch when it was introduced was to maintain responsiveness in user facing application code. You want your mouse to work. You need responsiveness to the keyboard. You want your screen to handle new drawing requests. Without asynchronous calls, this is not possible. As I understand things, you can use asynchronous methods when calling synchronous resources. That being said, is it really necessary to use asynchronous methods for every call through the entire call chain?
Am I missing something here? Does the question make sense to you? Do you have experience to share as part of this discussion? Please leave a comment for the rest of us.
Cheers,
Ben