@@ -5,7 +5,7 @@ use rand::distributions::{Alphanumeric, Uniform};
55use rand:: prelude:: SliceRandom ;
66use rand:: { thread_rng, Rng } ;
77use vortex_array:: array:: { PrimitiveArray , VarBinArray , VarBinViewArray } ;
8- use vortex_array:: { ArrayTrait , IntoArrayData as _, IntoCanonical as _ } ;
8+ use vortex_array:: { ArrayTrait , IntoCanonical as _, ToArrayData } ;
99use vortex_dict:: { dict_encode_primitive, dict_encode_varbin, dict_encode_varbinview, DictArray } ;
1010
1111fn gen_primitive_dict ( len : usize , uniqueness : f64 ) -> PrimitiveArray {
@@ -64,7 +64,7 @@ fn dict_decode(c: &mut Criterion) {
6464 group. throughput ( Throughput :: Bytes ( primitive_arr. nbytes ( ) as u64 ) ) ;
6565 group. bench_function ( "dict_decode_primitives" , |b| {
6666 b. iter_batched (
67- || DictArray :: try_new ( codes. clone ( ) . into_array ( ) , values. clone ( ) . into_array ( ) ) . unwrap ( ) ,
67+ || DictArray :: try_new ( codes. to_array ( ) , values. to_array ( ) ) . unwrap ( ) ,
6868 |dict_arr| black_box ( dict_arr. into_canonical ( ) . unwrap ( ) ) ,
6969 BatchSize :: SmallInput ,
7070 ) ;
@@ -75,7 +75,7 @@ fn dict_decode(c: &mut Criterion) {
7575 group. throughput ( Throughput :: Bytes ( varbin_arr. nbytes ( ) as u64 ) ) ;
7676 group. bench_function ( "dict_decode_varbin" , |b| {
7777 b. iter_batched (
78- || DictArray :: try_new ( codes. clone ( ) . into_array ( ) , values. clone ( ) . into_array ( ) ) . unwrap ( ) ,
78+ || DictArray :: try_new ( codes. to_array ( ) , values. to_array ( ) ) . unwrap ( ) ,
7979 |dict_arr| black_box ( dict_arr. into_canonical ( ) . unwrap ( ) ) ,
8080 BatchSize :: SmallInput ,
8181 ) ;
@@ -86,7 +86,7 @@ fn dict_decode(c: &mut Criterion) {
8686 group. throughput ( Throughput :: Bytes ( varbin_arr. nbytes ( ) as u64 ) ) ;
8787 group. bench_function ( "dict_decode_varbinview" , |b| {
8888 b. iter_batched (
89- || DictArray :: try_new ( codes. clone ( ) . into_array ( ) , values. clone ( ) . into_array ( ) ) . unwrap ( ) ,
89+ || DictArray :: try_new ( codes. to_array ( ) , values. to_array ( ) ) . unwrap ( ) ,
9090 |dict_arr| black_box ( dict_arr. into_canonical ( ) . unwrap ( ) ) ,
9191 BatchSize :: SmallInput ,
9292 ) ;
0 commit comments