Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-4717

[C#] Consider exposing ValueTask instead of Task

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.14.0
    • Component/s: C#

      Description

      See https://github.com/apache/arrow/pull/3736#pullrequestreview-207169204 for the discussion and https://devblogs.microsoft.com/dotnet/understanding-the-whys-whats-and-whens-of-valuetask/ for the reasoning.

      Using `Task<T>` in public API requires that a new Task instance be allocated on every call. When returning synchronously, using ValueTask will allow the method to not allocate.

      In order to do this, we will need to take a new dependency on  System.Threading.Tasks.Extensions NuGet package.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                eerhardt Eric Erhardt
                Reporter:
                eerhardt Eric Erhardt
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m