I have set-up the examples from this MSDN article Using Asynchronous Methods in ASP.NET MVC 4 and have done some benchmarking to see what I come up with.
webClient.DownloadString(uri)
to
var response = await httpClient.GetAsync(uri);
return (await response.Content.ReadAsAsync<object>());
maybe you can try
webclient.DownloadStringAsync(uri)
and you could optimize your async code to
await Task.Run(() => {
// just run your sync code here
var g1 = GetGizmos("url1");
var g2 = GetGizmos("url2");
var g3 = GetGizmos("url3");
return Content("");
});
It is enough to have one async yielding point here.
Refer to this answer for details about async: Do you have to put Task.Run in a method to make it async?