I was very impressed how coroutines where built into C++20 by generalizing the calling conventions1. Is this considered for the CLR? Would it even be worth it?
I assume that features like async
/await
and yield
would greatly benefit from that performance-wise, but the cost to change their implementations would be immense. However, laying the groundwork in the CLR might actually not be that costly...?
I'm just wondering whether this is on someones radar, because, so far, I could only find this comment in a charplang issue asking which CLR changes would benefit C# language features.
1 This summary of the feature (before it got standardized) gives a nice overview.
As far as I know nobody has done analysis of the estimated benefits and costs of having built-in coroutines support in the runtime. I agree that it would be useful to have such analysis so that we can compare the cost/benefit of doing this with other potential performance-related features.
Most helpful comment
As far as I know nobody has done analysis of the estimated benefits and costs of having built-in coroutines support in the runtime. I agree that it would be useful to have such analysis so that we can compare the cost/benefit of doing this with other potential performance-related features.