title: Measuring performance for async vs sync code in ASP.NET Core
body: <p>I'm trying to measure the performance of async vs sync in ASP.NET Core 3.1 with SQL Server Express and EF Core 3.1.3 and have two functions that are exactly the same except one is async and one is sync:</p>
  <pre><code>[HttpGet(&quot;search/description/{searchString}&quot;)]
  public async Task&lt;ActionResult&lt;IEnumerable&lt;Products&gt;&gt;&gt; SearchForProductsDescription(String searchString) {
      return await _context.Products.Where(p =&gt; p.Description == searchString).ToListAsync();
  }
  </code></pre>
  <p>And the sync version:</p>
  <pre><code>return _context.Products.Where(p =&gt; p.Description == searchString).ToList();
  </code></pre>
  <p>I'm using jmeter as a benchmark tool and the synchronous function is faster than the asynchronous one (as expected), but when I increase the number of threads in jmeter so the average response time is 500ms&lt;, the synchronous code is still faster. I've tried using 1000 rows and 20000 rows in the database but it's still faster. I'm trying to find a scenario where the async function is faster than the synchronous one but I'm having trouble, is there something I'm getting wrong or misunderstanding?</p>