title: ASP.NET Web API 2 Async action methods with Task.Run performance
body: <p>I'm trying to benchmark (using Apache bench) a couple of ASP.NET Web API 2.0 endpoints. One of which is synchronous and one async.</p>
  
  <pre><code>        [Route("user/{userId}/feeds")]
          [HttpGet]
          public IEnumerable&lt;NewsFeedItem&gt; GetNewsFeedItemsForUser(string userId)
          {
              return _newsFeedService.GetNewsFeedItemsForUser(userId);
          }
  
          [Route("user/{userId}/feeds/async")]
          [HttpGet]
          public async Task&lt;IEnumerable&lt;NewsFeedItem&gt;&gt; GetNewsFeedItemsForUserAsync(string userId)
          {
              return await Task.Run(() =&gt; _newsFeedService.GetNewsFeedItemsForUser(userId));
          }
  </code></pre>
  
  <p>After watching <a href="http://channel9.msdn.com/Events/TechDays/Techdays-2012-the-Netherlands/2287" rel="noreferrer">Steve Sanderson's presentation</a> I issued the following command <code>ab -n 100 -c 10 http://localhost....</code> to each endpoint. </p>
  
  <p>I was surprised as the benchmarks for each endpoint seemed to be approximately the same.</p>
  
  <p>Going off what Steve explained I was expecting that the async endpoint would be more performant because it would release thread pool threads back to the thread pool immediately, thus making them available for other requests and improving throughput. But the numbers seem exactly the same.</p>
  
  <p>What am I misunderstanding here?</p>