Commits


Sutou Kouhei authored and Yosuke Shiro committed e29732be869
ARROW-6351: [Ruby] Improve Arrow#values performance Type | Before | After | Speedup ratio ---------- | --------- | ----------- | ------------- Boolean | 100.9 i/s | 34711.9 i/s | 343.87x Decimal128 | 70.1 i/s | 660.7 i/s | 9.42x Dictionary | 59.1 i/s | 8542.6 i/s | 144.54x Int64 | 101.8 i/s | 41414.1 i/s | 406.72x String | 96.3 i/s | 17146.7 i/s | 178.13x Timestamp | 85.9 i/s | 1402.6 i/s | 16.32x See ruby/red-arrow/benchmark/values/ for benchmark details. This also adds ChunkedArray#values. ruby/red-arrow/ext/arrow/converters.*: ruby/red-arrow/ext/arrow/raw-records.cpp: It extracts convert related features from raw-records.cpp to converters.*. raw-records.cpp just uses convert related features extracted to converters.*. The logic for convert related features aren't changed. ruby/red-arrow/ext/arrow/values.cpp: It just uses extracted convert related features. ruby/red-arrow/lib/arrow/loader.rb: It maps the original Arrow::Array#values to Arrow::Array#raw_values to use Arrow::Array#values defined in ruby/red-arrow/ext/arrow/arrow.cpp. ruby/red-arrow/lib/arrow/array.rb: It changes to fast Arrow::Array#values for Arrow::Array#to_a instead of Enumerable#to_a. ruby/red-arrow/benchmark/raw-records/: Faker API is changed since Faker 2.0.0. This change uses the new Faker API. Closes #5194 from kou/ruby-raw-values and squashes the following commits: b8a5a19af <Sutou Kouhei> Extract common codes as Converter f4c113a55 <Sutou Kouhei> Remove needless "Raw" prefix 268b0474f <Sutou Kouhei> Improve Arrow#values performance Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Yosuke Shiro <yosuke.shiro615@gmail.com>