use `ValueTask` instead of `Task` if possible
For compat reason we're returning from the API Tasks we could have some performance benefit (expecially for the IMessageBus IDataConsumer) if we move it to ValueTask.
Are you thinking of multi-tfm code or dropping netstandard 2.0?
Are you thinking of multi-tfm code or dropping netstandard 2.0?
We won't never drop netstandard2.0 so or we take a dep there with ValueTask from official package(https://www.nuget.org/packages/System.Threading.Tasks.Extensions/) or #ifdef.
How common it is that APIs in question will complete synchronously? Do we have that data?
How common it is that APIs in question will complete synchronously? Do we have that data?
We don't have info about it, also it's not easy, vast majority of time code run sync but depends on the machine load, CI are not big machines and usually busy so the decision to provide async everywhere. For the APIs in question we meant all extensions interfaces.
Discussed offline with @MarcoRossignoli about this and it seems that the perf gain would be limited and it's not something where we have issues as of today so adding complexity on extension users seems useless.
Closing as won't fix.