Skip to content

Instantly share code, notes, and snippets.

View adrianstevens's full-sized avatar

Adrian Stevens adrianstevens

View GitHub Profile
@bradwilson
bradwilson / gist:05ffdad8c73cf9230261
Created April 23, 2015 17:15
Beware the cost of "async"
// Don't do this, because you don't need async if you're only calling one
// downstream async method and returning its value, unprocessed.
public async Task<int> DoSomething(int x, int y)
{
return await SlowMath.AddAsync(x, y);
}
// Do this instead:
public Task<int> DoSomething(int x, int y)
{