[ 
https://issues.apache.org/jira/browse/ARROW-7051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17394141#comment-17394141
 ] 

Antoine Pitrou commented on ARROW-7051:
---------------------------------------

Another approach would be to define a separate function that caches 
power-of-two-sized buffers of zeros:
{code:c++}
/// Make read-only buffer of zeros
Result<std::shared_ptr<Buffer>> MakeBufferOfZeros(int64_t length);
{code}

The two approaches might be combined for maximum efficiency...

> [C++] Improve MakeArrayOfNull to support creation of multiple arrays
> --------------------------------------------------------------------
>
>                 Key: ARROW-7051
>                 URL: https://issues.apache.org/jira/browse/ARROW-7051
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>    Affects Versions: 0.14.0
>            Reporter: Ben Kietzman
>            Priority: Minor
>              Labels: beginner
>
> MakeArrayOfNull reuses a single buffer of {{0}} for all buffers in the array 
> it creates. It could be extended to reuse that same buffer for all buffers in 
> multiple arrays. This optimization will make RecordBatchProjector and 
> ConcatenateTablesWithPromotion more memory efficient



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to