- C# 7 and .NET Core Cookbook
- Dirk Strauss
- 47字
- 2021-07-03 00:11:56
How it works...
ValueTask<T> is a very nice addition to C# 7.0. Microsoft, however, does suggest that you benchmark the performance of Task<T> versus ValueTask<T> when doing additional optimizing of your methods. A simple optimization however would be to simply replace the instances of Task<T> with ValueTask<T>.