Commits


Eric Erhardt authored and Wes McKinney committed 3514a37091a
ARROW-4717 [C#] Consider exposing ValueTask instead of Task Eliminating allocations in the C# Arrow library: 1. Use ValueTask instead of Task in the public APIs. 2. Eliminate allocations in ArrayData constructor by taking an array directly instead of calling `ToArray()` every time. 3. Remove some other minor allocations that provide no benefit. 4. Also, add a simple `NullCount == 0` check to optimize the case where there are no nulls in the data, but the null bitmap is filled with 0s instead of being empty. With this change the `ArrowReaderWithMemory` benchmark in the repo goes from: ## Before | Method | Allocated Memory/Op | |---------------------------- |--------------------:| | ArrowReaderWithMemory | 5.84 KB | ## After | Method | Allocated Memory/Op | |---------------------------- |--------------------:| | ArrowReaderWithMemory | 4.48 KB | @stephentoub @pgovind @chutchinson Author: Eric Erhardt <eric.erhardt@microsoft.com> Closes #4194 from eerhardt/ValueTask and squashes the following commits: d2a00afd9 <Eric Erhardt> PR feedback. 310bb2f3b <Eric Erhardt> Convert all Task usages to ValueTask to save on allocations. d1d2687d5 <Eric Erhardt> Minor optimizations