3 ms·
I may remember wrongly here, but wasn't ValueTask merely the go-to option when it's expected that the task would finish synchronously most of the time? I think
by ygra 3y ago
I may remember wrongly here, but wasn't ValueTask merely the go-to option when it's expected that the task would finish synchronously most of the time? I think for the really async case with a state machine you just end up boxing the ValueTask and ending up with pretty much the same allocations as Task, just in a slightly different way.
- evntdrvn 3y agoCheck out this article: https://devblogs.microsoft.com/dotnet/async-valuetask-pooling-in-net-5/ https://devblogs.microsoft.com/dotnet/async-valuetask-poolin...