title: Do nested async/await calls give any performance boost?
body: <p>This is somewhat related to <a href="https://stackoverflow.com/questions/29808915/why-use-async-await-all-the-way-down">Why use Async/await all the way down</a> . I have some legacy EF Core I need to maintain with lots of nested calls that are not async. I am wondering if it is just ok to make the top level controller only async and wrap the service call with a Task.Run().</p>
  <p>What is the difference between these 2 controller actions.
  In the first one, EF core is called synchronously. But the call
  is wrapped in a Task.Run so I assume it will be executed asynchronously</p>
  <p>In the second, the EF core calls is async
  But is it even necessary since the controller action is async?
  Will async within async within async... give any performance boost over just one async call at the top?</p>
  <p>case 1</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    //controller, async call
      public async Task&lt;ActionList&lt;string&gt;&gt; GetNames()
      {
          var names = await Task.Run(() =&gt; peopleService.GetNames());
          return Ok(names);
      }
  
  //people service layer, no async
  public List&lt;string&gt; GetNames()
  {
      return _context.People.Where(...).Select(x =&gt; x.Name).ToList();
  }</code></pre>
  </div>
  </div>
  </p>
  <p>case 2</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>//controller, async
  public async Task&lt;ActionList&lt;string&gt;&gt; GetNames()
  {
      var names = await  peopleService.GetNames();
      return Ok(names);
  }
  
  //people service layer, async
  public async Task&lt;List&lt;string&gt;&gt; GetNamesAsync()
  {
      return await _context.People.Where(...).Select(x =&gt; x.Name).ToListAsync();
  }</code></pre>
  </div>
  </div>
  </p>
  <hr />