Objective:
For Task<T>
and ValueTask<T>
(T
=int
as a common non-trivial but inlineable case), compare async performance in
the synchronous scenario (i.e. where data happens to be buffered - common in deserialization etc code) for 3 implementations:
- using
await
throughout - using synchronous code until incompleteness detected (via
IsCompleted
); switch via localasync Awaited
if needed - using synchronous code until incompleteness detected (via
IsCompletedSuccessfully
); switch via localasync Awaited
if needed
Note: