for understanding what the difference could be in awaiting a
Task
Task
vs a
ValueTask
ValueTask
to my surprise awaiting ValueTask.AsTask() is faster than await the original
ValueTask
ValueTask
if i have some time later i could look at generated code, but in the mean time even if i understand this perf difference is pretty much irrelevant in my code and that the test is really not what would happen in a real situation, if someone had some insights on what's happening it would be really appreciated https://github.com/ontorder/Benchmarks/blob/main/AsTask-Benchmark.cs (note: this is run in .NET 8, not 10) (ps sure if i avoid the await at all then the valuetask version is faster, but that's just for comparison)