CommunityToolkit / dotnet

.NET Community Toolkit is a collection of helpers and APIs that work for all .NET developers and are agnostic of any specific UI platform. The toolkit is maintained and published by Microsoft, and part of the .NET Foundation.
https://docs.microsoft.com/dotnet/communitytoolkit/?WT.mc_id=dotnet-0000-bramin
Other
2.99k stars 294 forks source link

Source generators should check for cancellation more often #703

Closed Sergio0694 closed 1 year ago

Sergio0694 commented 1 year ago

Overview

Currently, the MVVM Toolkit source generators are propagating the cancellation token in each callback to all calls that need one, but they're not checking for cancellation themselves that much. This can increase overhead when concurrent invocations are triggered, as previous runs of the generators will take longer before they get to a point where they can detect they've been cancelled. We should update them to add more cancellation checks in places that make sense.