← Back
Nick Chapsas November 3, 2025 39s

ValueTask vs Task in .NET

Summary

The transcript discusses optimizing asynchronous methods in high-frequency .NET code paths by using ValueTask instead of Task to reduce heap allocations. The key recommendation is to leverage ValueTask in scenarios like caching, where methods can complete synchronously, resulting in zero allocations and improved performance. For high-throughput applications, developers should use ValueTask, remembering that it can only be awaited once and should be used immediately without storing and re-awaiting.

View original episode ↗