apache / arrow

Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing
https://arrow.apache.org/
Apache License 2.0
14.24k stars 3.47k forks source link

[R] Deduplicate strings using Arrow hash tables instead of passing all values through R's global hash table #22622

Open asfimport opened 5 years ago

asfimport commented 5 years ago

I suspect that deserialization performance from Arrow to R vector can be improved by deduplicating strings locally prior to setting into R character vectors. You can see our corresponding deduplication logic in Python (which is a slightly different situation because Python does not have a GSHT, but we can have many references to the same object in an output NumPy array)

https://github.com/apache/arrow/blob/master/cpp/src/arrow/python/arrow_to_pandas.cc#L409

Reporter: Wes McKinney / @wesm

Note: This issue was originally created as ARROW-6236. Please see the migration documentation for further details.

asfimport commented 5 years ago

Wes McKinney / @wesm: Some basic profiling I did suggested the performance gains may not be that significant but it would be worth taking a closer look to see