From 807fd6d6a0664c3e9a5c85caac4219027929b526 Mon Sep 17 00:00:00 2001 From: Jaroslav Tulach Date: Tue, 11 Jun 2024 10:02:17 +0200 Subject: [PATCH] create_arrow_columns function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Radosław Waśko --- test/Benchmarks/src/Table/Arithmetic.enso | 29 ++++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/test/Benchmarks/src/Table/Arithmetic.enso b/test/Benchmarks/src/Table/Arithmetic.enso index f3638683ee14..8bf04d1e9557 100644 --- a/test/Benchmarks/src/Table/Arithmetic.enso +++ b/test/Benchmarks/src/Table/Arithmetic.enso @@ -36,6 +36,20 @@ create_table num_rows = Runtime.assert ((t.at "Z" . value_type) == Value_Type.Integer) t +create_arrow_columns num_rows = + column_to_arrow v:Vector -> Array = + builder = int64_new.new v.length + v.map e-> builder.append e + builder.build + + v = create_vectors num_rows + + x = column_to_arrow (v.at 0) + y = column_to_arrow (v.at 1) + u = column_to_arrow (v.at 2) + z = column_to_arrow (v.at 3) + [int64_plus, x, y, u, z] + foreign arrow int64_new = """ new[Int64] @@ -51,20 +65,7 @@ type Data arrow_u self = self.arrow.at 3 arrow_z self = self.arrow.at 4 - create num_rows = Data.Value (create_table num_rows) <| - column_to_arrow v:Vector -> Array = - builder = int64_new.new v.length - v.map e-> builder.append e - builder.build - - v = create_vectors num_rows - - x = column_to_arrow (v.at 0) - y = column_to_arrow (v.at 1) - u = column_to_arrow (v.at 2) - z = column_to_arrow (v.at 3) - [int64_plus, x, y, u, z] - + create num_rows = Data.Value (create_table num_rows) (create_arrow_columns num_rows) collect_benches = Bench.build builder-> column_arithmetic_plus_fitting d =