Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
Description
When reading `RecordBatch` instances using the `ArrowStreamReader` class, it is currently allocating and copying memory 3 times for the data.
- It is allocating memory in order to read the data from the Stream, and then reading from the Stream. (This should be the only allocation that is necessary.)
- It then creates a new `ArrowBuffer.Builder`, which allocates another `byte[]`, and calls `Append` on it, which copies the values to the new `byte[]`.
- Finally, it then calls `.Build()` on the `ArrowBuffer.Builder`, which allocates memory from the MemoryPool, and then copies the intermediate buffer into it.
We should reduce this overhead to only allocating a single time (from the MemoryPool), and not copying the data more times than necessary.
Attachments
Issue Links
- links to