Closed linkdotnet closed 2 months ago
Fixes #44 Fixes #59
@linkdotnet what do you think about converting Task
to ValueTask
for IJob.RunAsync
? Since this already creates breaking changes to IJob if changing to ValueTask improves performance then it can be included. Of course, I would need to run some benchmarks before making any changes.
@linkdotnet what do you think about converting
Task
toValueTask
forIJob.RunAsync
? Since this already creates breaking changes to IJob if changing to ValueTask improves performance then it can be included. Of course, I would need to run some benchmarks before making any changes.
That is a good idea - I didn't have very much time lately but those smaller things seemed somewhat in reach without investing hours in one session (what one would need for bigger features).
Coming back - ValueTask
might be a good choice here as well. Absolutely.
I will create a ticket for that.
One has to figure out how we can "warn" users that are using Minimal API, that are returning Task
and don0t get a compiler hint. We might want to transform the Task
automatically to a ValueTask
. In general that would be dangerous but from our libraries point of view, that should be fine.
Edit: On second thought: Maybe the risk introduced doesn't justify the benefit (if there is at all).
Given that Jobs are normally I/O bound and "slow" in nature, using ValueTask
might have <0.01% impact in allocations/performance.
This is the ongoing branch for
v3
.