© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
46 replies
Thinker

When to use ValueTask?

Despite having used C# for a while I'm... not that familiar with async. I know people sometimes say to sometimes use
ValueTask<T>
ValueTask<T>
instead of
Task<T>
Task<T>
, but when should you exactly do this? The extent of my knowledge (and reading the docs) is that
ValueTask<T>
ValueTask<T>
is like a DU between either a
T
T
value or a
Task<T>
Task<T>
, so is it ideal for situations in which an async method may just return a cached value?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,828Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

when to use switches and when to use if statements?
C#CC# / help
2y ago
when to use var keyword and when to use data type itself
C#CC# / help
13mo ago
✅ When to use each constructor?
C#CC# / help
11mo ago
When to use Dependency injection?
C#CC# / help
16mo ago