Use ValueTask and IValueTaskSource for OperationBase.Completed
Description
We can reduce heap allocations for operations by not allocating a TaskCompleteSource and Task for every operation (times the number of attempts for retries). Instead, we can use ValueTask and IValueTaskSource, keeping the required fields on the OperationBase object already allocated using the ManualResetValueTaskSourceCore structure.
Environment
None
Gerrit Reviews
None
Release Notes Description
None
Activity
Show:
Jeffry Morris February 2, 2021 at 2:21 AM
Thanks Brant!
Fixed
Pinned fields
Click on the next to a field label to start pinning.
We can reduce heap allocations for operations by not allocating a TaskCompleteSource and Task for every operation (times the number of attempts for retries). Instead, we can use ValueTask and IValueTaskSource, keeping the required fields on the OperationBase object already allocated using the ManualResetValueTaskSourceCore structure.