You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Antoine Pitrou (Jira)" <ji...@apache.org> on 2019/08/28 15:58:00 UTC

[jira] [Commented] (ARROW-6375) [C++] Extend ConversionTraits to allow efficiently appending list values in STL API

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

Antoine Pitrou commented on ARROW-6375:
---------------------------------------

[~ozars] What you're proposing sounds ok on the principle. Would you like to try submitting a PR?

> [C++] Extend ConversionTraits to allow efficiently appending list values in STL API
> -----------------------------------------------------------------------------------
>
>                 Key: ARROW-6375
>                 URL: https://issues.apache.org/jira/browse/ARROW-6375
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Omer Ozarslan
>            Priority: Major
>
> I was trying to benchmark performances of using array builders vs. STL API for converting some row data to arrow tables. I realized it is around 1.5-1.8 times slower to convert {{std::vector}} values with STL API than doing so with builder API. It appears this is primarily due to appending rows via {{...::Append}} method by iterating over {{ConversionTrait<std::vector<...>>::AppendRow}} for each value.
> Calling {{...::AppendValues}} would make it more efficient, however, {{ConversionTraits}} doesn't offer a way for appending more than one cells ({{AppendRow}} takes a builder and a single cell as its parameters).
> Would it be possible to extend conversion traits with an optional method {{AppendRows(Builder, Cell*, size_t),}} which allows template specialization to efficiently append multiple cells at once? In the example above this function would be called with {{std::vector::data()}} and {{std::vector::size()}} if provided. If such method isn't provided by the specialization, current behavior (i.e. iterating over {{AppendRow}}) can be used as default.
> [This|https://github.com/apache/arrow/blob/e29732be86958e563801c55d3fcd8dc3fe4e9801/cpp/src/arrow/stl.h#L97-L100] is the particular part in code that will be replaced in practice. Instead of directly calling AppendRow in a for loop, a public helper function (e.g. {{stl::AppendRows}}) can be provided, in which it implements above logic.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)