- C# 7 and .NET Core Cookbook
- Dirk Strauss
- 47字
- 2025-04-04 19:28:52
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>.