@@ -30,7 +30,7 @@ const BENCH_ARGS: &[(usize, usize)] = &[
3030fn chunked_bool_canonical_into ( bencher : Bencher , ( len, chunk_count) : ( usize , usize ) ) {
3131 let chunk = make_bool_chunks ( len, chunk_count) ;
3232
33- bencher. with_inputs ( || chunk. clone ( ) ) . bench_values ( |chunk| {
33+ bencher. with_inputs ( || & chunk) . bench_refs ( |chunk| {
3434 let mut builder = builder_with_capacity ( chunk. dtype ( ) , len * chunk_count) ;
3535 chunk. append_to_builder ( builder. as_mut ( ) ) ;
3636 builder. finish ( )
@@ -41,9 +41,9 @@ fn chunked_bool_canonical_into(bencher: Bencher, (len, chunk_count): (usize, usi
4141fn chunked_opt_bool_canonical_into ( bencher : Bencher , ( len, chunk_count) : ( usize , usize ) ) {
4242 let chunk = make_opt_bool_chunks ( len, chunk_count) ;
4343
44- bencher. with_inputs ( || chunk. clone ( ) ) . bench_values ( |chunk| {
44+ bencher. with_inputs ( || & chunk) . bench_refs ( |chunk| {
4545 let mut builder = builder_with_capacity ( chunk. dtype ( ) , len * chunk_count) ;
46- chunk. clone ( ) . append_to_builder ( builder. as_mut ( ) ) ;
46+ chunk. append_to_builder ( builder. as_mut ( ) ) ;
4747 builder. finish ( )
4848 } )
4949}
@@ -53,67 +53,63 @@ fn chunked_bool_into_canonical(bencher: Bencher, (len, chunk_count): (usize, usi
5353 let chunk = make_bool_chunks ( len, chunk_count) ;
5454
5555 bencher
56- . with_inputs ( || chunk. clone ( ) )
57- . bench_values ( |chunk| chunk. to_canonical ( ) )
56+ . with_inputs ( || & chunk)
57+ . bench_refs ( |chunk| chunk. to_canonical ( ) )
5858}
5959
6060#[ divan:: bench( args = BENCH_ARGS ) ]
6161fn chunked_opt_bool_into_canonical ( bencher : Bencher , ( len, chunk_count) : ( usize , usize ) ) {
6262 let chunk = make_opt_bool_chunks ( len, chunk_count) ;
6363
6464 bencher
65- . with_inputs ( || chunk. clone ( ) )
66- . bench_values ( |chunk| chunk. to_canonical ( ) )
65+ . with_inputs ( || & chunk)
66+ . bench_refs ( |chunk| chunk. to_canonical ( ) )
6767}
6868
6969#[ divan:: bench( args = BENCH_ARGS ) ]
7070fn chunked_varbinview_canonical_into ( bencher : Bencher , ( len, chunk_count) : ( usize , usize ) ) {
7171 let chunks = make_string_chunks ( false , len, chunk_count) ;
7272
73- bencher
74- . with_inputs ( || chunks. clone ( ) )
75- . bench_values ( |chunk| {
76- let mut builder = VarBinViewBuilder :: with_capacity (
77- DType :: Utf8 ( chunk. dtype ( ) . nullability ( ) ) ,
78- len * chunk_count,
79- ) ;
80- chunk. append_to_builder ( & mut builder) ;
81- builder. finish ( )
82- } )
73+ bencher. with_inputs ( || & chunks) . bench_refs ( |chunk| {
74+ let mut builder = VarBinViewBuilder :: with_capacity (
75+ DType :: Utf8 ( chunk. dtype ( ) . nullability ( ) ) ,
76+ len * chunk_count,
77+ ) ;
78+ chunk. append_to_builder ( & mut builder) ;
79+ builder. finish ( )
80+ } )
8381}
8482
8583#[ divan:: bench( args = BENCH_ARGS ) ]
8684fn chunked_varbinview_into_canonical ( bencher : Bencher , ( len, chunk_count) : ( usize , usize ) ) {
8785 let chunks = make_string_chunks ( false , len, chunk_count) ;
8886
8987 bencher
90- . with_inputs ( || chunks. clone ( ) )
91- . bench_values ( |chunk| chunk. to_canonical ( ) )
88+ . with_inputs ( || & chunks)
89+ . bench_refs ( |chunk| chunk. to_canonical ( ) )
9290}
9391
9492#[ divan:: bench( args = BENCH_ARGS ) ]
9593fn chunked_varbinview_opt_canonical_into ( bencher : Bencher , ( len, chunk_count) : ( usize , usize ) ) {
9694 let chunks = make_string_chunks ( true , len, chunk_count) ;
9795
98- bencher
99- . with_inputs ( || chunks. clone ( ) )
100- . bench_values ( |chunk| {
101- let mut builder = VarBinViewBuilder :: with_capacity (
102- DType :: Utf8 ( chunk. dtype ( ) . nullability ( ) ) ,
103- len * chunk_count,
104- ) ;
105- chunk. append_to_builder ( & mut builder) ;
106- builder. finish ( )
107- } )
96+ bencher. with_inputs ( || & chunks) . bench_refs ( |chunk| {
97+ let mut builder = VarBinViewBuilder :: with_capacity (
98+ DType :: Utf8 ( chunk. dtype ( ) . nullability ( ) ) ,
99+ len * chunk_count,
100+ ) ;
101+ chunk. append_to_builder ( & mut builder) ;
102+ builder. finish ( )
103+ } )
108104}
109105
110106#[ divan:: bench( args = BENCH_ARGS ) ]
111107fn chunked_varbinview_opt_into_canonical ( bencher : Bencher , ( len, chunk_count) : ( usize , usize ) ) {
112108 let chunks = make_string_chunks ( true , len, chunk_count) ;
113109
114110 bencher
115- . with_inputs ( || chunks. clone ( ) )
116- . bench_values ( |chunk| chunk. to_canonical ( ) )
111+ . with_inputs ( || & chunks)
112+ . bench_refs ( |chunk| chunk. to_canonical ( ) )
117113}
118114
119115fn make_opt_bool_chunks ( len : usize , chunk_count : usize ) -> ArrayRef {
0 commit comments