GR0066: Consider ValueTask instead of Task
| Title | Consider ValueTask<T> instead of Task<T> |
|---|---|
| Id | GR0066 |
| Category | Performance |
| Default Severity | Info |
| Enabled By Default | True |
| Description | When a method frequently completes synchronously (e.g. via Task.FromResult or a fast-path branch), returning ValueTask<T> avoids a heap allocation. This is a performance suggestion only; ValueTask<T> has stricter consumption rules and is not universally better than Task<T>. |
| Custom Tags |