55 clippy:: unwrap_used,
66 clippy:: clone_on_ref_ptr,
77 clippy:: cloned_ref_to_slice_refs,
8- clippy:: cast_possible_truncation,
9- clippy:: cast_possible_wrap,
108 clippy:: redundant_clone
119) ]
1210
13- //! Row-encode throughput benchmarks comparing `arrow-row` against vortex's `convert_columns`
14- //! for the canonical scenarios shipped in PR 1: a primitive i64 column, a Utf8 column,
15- //! and a mixed-field struct. Per-encoding fast paths (Constant, Dict, Patched, BitPacked,
16- //! FoR, Delta) gain their own triplets in PR 3.
11+ //! Row-encode throughput benchmarks comparing `arrow-row` against Vortex's [`RowEncoder`]
12+ //! for the core canonical scenarios: a primitive i64 column, a Utf8 column, and a
13+ //! mixed-field struct.
1714
1815use std:: sync:: Arc ;
1916
@@ -36,8 +33,7 @@ use vortex_array::VortexSessionExecute;
3633use vortex_array:: arrays:: PrimitiveArray ;
3734use vortex_array:: arrays:: StructArray ;
3835use vortex_array:: arrays:: VarBinViewArray ;
39- use vortex_row:: SortField ;
40- use vortex_row:: convert_columns;
36+ use vortex_row:: RowEncoder ;
4137
4238#[ global_allocator]
4339static GLOBAL : MiMalloc = MiMalloc ;
@@ -86,9 +82,10 @@ fn primitive_i64_vortex(bencher: divan::Bencher) {
8682 let v = gen_i64 ( N , 0 ) ;
8783 let col = PrimitiveArray :: from_iter ( v. clone ( ) ) . into_array ( ) ;
8884 let bytes = ( N * ( 1 + 8 ) ) as u64 ;
85+ let encoder = RowEncoder :: default ( ) ;
8986 bencher. counter ( BytesCount :: new ( bytes) ) . bench_local ( || {
9087 let mut ctx = LEGACY_SESSION . create_execution_ctx ( ) ;
91- convert_columns ( & [ col. clone ( ) ] , & [ SortField :: default ( ) ] , & mut ctx) . unwrap ( )
88+ encoder . encode ( & [ col. clone ( ) ] , & mut ctx) . unwrap ( )
9289 } )
9390}
9491
@@ -116,9 +113,10 @@ fn utf8_vortex(bencher: divan::Bencher) {
116113 . map ( |w| 1 + ( w. len ( ) . div_ceil ( 32 ) * 33 ) as u64 )
117114 . sum ( ) ;
118115 let col = VarBinViewArray :: from_iter_str ( words. iter ( ) . map ( String :: as_str) ) . into_array ( ) ;
116+ let encoder = RowEncoder :: default ( ) ;
119117 bencher. counter ( BytesCount :: new ( total) ) . bench_local ( || {
120118 let mut ctx = LEGACY_SESSION . create_execution_ctx ( ) ;
121- convert_columns ( & [ col. clone ( ) ] , & [ SortField :: default ( ) ] , & mut ctx) . unwrap ( )
119+ encoder . encode ( & [ col. clone ( ) ] , & mut ctx) . unwrap ( )
122120 } )
123121}
124122
@@ -170,8 +168,9 @@ fn struct_mixed_vortex(bencher: divan::Bencher) {
170168 let struct_arr = StructArray :: from_fields ( & [ ( "id" , id_arr) , ( "name" , name_arr) ] )
171169 . unwrap ( )
172170 . into_array ( ) ;
171+ let encoder = RowEncoder :: default ( ) ;
173172 bencher. counter ( BytesCount :: new ( total) ) . bench_local ( || {
174173 let mut ctx = LEGACY_SESSION . create_execution_ctx ( ) ;
175- convert_columns ( & [ struct_arr. clone ( ) ] , & [ SortField :: default ( ) ] , & mut ctx) . unwrap ( )
174+ encoder . encode ( & [ struct_arr. clone ( ) ] , & mut ctx) . unwrap ( )
176175 } )
177176}
0 commit comments