Build with an Azure free account. Get USD200 credit for 30 days and 12 months of free services.

Start free today

Understanding how to use Task and ValueTask

Play Understanding how to use Task and ValueTask
Sign in to queue


In this episode, Stephen Toub chats with Rich about ValueTask<T> and how it might help reduce allocations and memory usage for your asynchronous .NET code.

  • [00:34] - What is ValueTask and why do we need it?
  • [05:22] - What is a good scenario for ValueTask?
  • [10:00] - What is IValueTask<T>?
  • [12:14] - Why was the non-generic ValueTask introduced?
  • [13:54] - Does ValueTask offer cancellation?
  • [14:42] - What can you do with Task vs ValueTask?
  • [16:28] - What's the uptake with ValueTask usage?
  • [18:28] - How does IAsyncEnumerable task advantage of ValueTask?
  • [21:11] - What other performance work is happening around allocations?


Useful Links




The Discussion

Add Your 2 Cents