Most async methods return Task<T> even when they complete synchronously.
✅ Better for hot paths
public ValueTask<int> GetCachedValueAsync()
{
return ValueTask.FromResult(42);
}
When to use
-
Cache hits
-
High-frequency calls
-
Allocation-sensitive paths
