@@ -28,7 +28,7 @@ fn take_10_stratified(bencher: Bencher) {
2828 let indices = PrimitiveArray :: from_iter ( ( 0 ..10 ) . map ( |i| i * 10_000 ) ) ;
2929
3030 bencher
31- . with_inputs ( || ( packed. clone ( ) , indices. clone ( ) ) )
31+ . with_inputs ( || ( & packed, & indices) )
3232 . bench_refs ( |( packed, indices) | take ( packed. as_ref ( ) , indices. as_ref ( ) ) . unwrap ( ) )
3333}
3434
@@ -40,7 +40,7 @@ fn take_10_contiguous(bencher: Bencher) {
4040 let indices = buffer ! [ 0 ..10 ] . into_array ( ) ;
4141
4242 bencher
43- . with_inputs ( || ( packed. clone ( ) , indices. clone ( ) ) )
43+ . with_inputs ( || ( & packed, & indices) )
4444 . bench_refs ( |( packed, indices) | take ( packed. as_ref ( ) , indices. as_ref ( ) ) . unwrap ( ) )
4545}
4646
@@ -55,7 +55,7 @@ fn take_10k_random(bencher: Bencher) {
5555 let indices = PrimitiveArray :: from_iter ( rng. sample_iter ( range) . take ( 10_000 ) . map ( |i| i as u32 ) ) ;
5656
5757 bencher
58- . with_inputs ( || ( packed. clone ( ) , indices. clone ( ) ) )
58+ . with_inputs ( || ( & packed, & indices) )
5959 . bench_refs ( |( packed, indices) | take ( packed. as_ref ( ) , indices. as_ref ( ) ) . unwrap ( ) )
6060}
6161
@@ -67,7 +67,7 @@ fn take_10k_contiguous(bencher: Bencher) {
6767 let indices = PrimitiveArray :: from_iter ( 0 ..10_000 ) ;
6868
6969 bencher
70- . with_inputs ( || ( packed. clone ( ) , indices. clone ( ) ) )
70+ . with_inputs ( || ( & packed, & indices) )
7171 . bench_refs ( |( packed, indices) | take ( packed. as_ref ( ) , indices. as_ref ( ) ) . unwrap ( ) )
7272}
7373
@@ -79,7 +79,7 @@ fn take_200k_dispersed(bencher: Bencher) {
7979 let indices = PrimitiveArray :: from_iter ( ( 0 ..200_000 ) . map ( |i| ( i * 42 ) % values. len ( ) as u64 ) ) ;
8080
8181 bencher
82- . with_inputs ( || ( packed. clone ( ) , indices. clone ( ) ) )
82+ . with_inputs ( || ( & packed, & indices) )
8383 . bench_refs ( |( packed, indices) | take ( packed. as_ref ( ) , indices. as_ref ( ) ) . unwrap ( ) )
8484}
8585
@@ -91,7 +91,7 @@ fn take_200k_first_chunk_only(bencher: Bencher) {
9191 let indices = PrimitiveArray :: from_iter ( ( 0 ..200_000 ) . map ( |i| ( ( i * 42 ) % 1024 ) as u64 ) ) ;
9292
9393 bencher
94- . with_inputs ( || ( packed. clone ( ) , indices. clone ( ) ) )
94+ . with_inputs ( || ( & packed, & indices) )
9595 . bench_refs ( |( packed, indices) | take ( packed. as_ref ( ) , indices. as_ref ( ) ) . unwrap ( ) )
9696}
9797
@@ -130,7 +130,7 @@ fn patched_take_10_stratified(bencher: Bencher) {
130130 let indices = PrimitiveArray :: from_iter ( ( 0 ..10 ) . map ( |i| i * 10_000 ) ) ;
131131
132132 bencher
133- . with_inputs ( || ( packed. clone ( ) , indices. clone ( ) ) )
133+ . with_inputs ( || ( & packed, & indices) )
134134 . bench_refs ( |( packed, indices) | take ( packed. as_ref ( ) , indices. as_ref ( ) ) . unwrap ( ) )
135135}
136136
@@ -149,7 +149,7 @@ fn patched_take_10_contiguous(bencher: Bencher) {
149149 let indices = buffer ! [ 0 ..10 ] . into_array ( ) ;
150150
151151 bencher
152- . with_inputs ( || ( packed. clone ( ) , indices. clone ( ) ) )
152+ . with_inputs ( || ( & packed, & indices) )
153153 . bench_refs ( |( packed, indices) | take ( packed. as_ref ( ) , indices. as_ref ( ) ) . unwrap ( ) )
154154}
155155
@@ -164,7 +164,7 @@ fn patched_take_10k_random(bencher: Bencher) {
164164 let indices = PrimitiveArray :: from_iter ( rng. sample_iter ( range) . take ( 10_000 ) . map ( |i| i as u32 ) ) ;
165165
166166 bencher
167- . with_inputs ( || ( packed. clone ( ) , indices. clone ( ) ) )
167+ . with_inputs ( || ( & packed, & indices) )
168168 . bench_refs ( |( packed, indices) | take ( packed. as_ref ( ) , indices. as_ref ( ) ) . unwrap ( ) )
169169}
170170
@@ -176,7 +176,7 @@ fn patched_take_10k_contiguous_not_patches(bencher: Bencher) {
176176 let indices = PrimitiveArray :: from_iter ( ( 0u32 ..NUM_EXCEPTIONS ) . cycle ( ) . take ( 10000 ) ) ;
177177
178178 bencher
179- . with_inputs ( || ( packed. clone ( ) , indices. clone ( ) ) )
179+ . with_inputs ( || ( & packed, & indices) )
180180 . bench_refs ( |( packed, indices) | take ( packed. as_ref ( ) , indices. as_ref ( ) ) . unwrap ( ) )
181181}
182182
@@ -196,7 +196,7 @@ fn patched_take_10k_contiguous_patches(bencher: Bencher) {
196196 PrimitiveArray :: from_iter ( ( BIG_BASE2 ..BIG_BASE2 + NUM_EXCEPTIONS ) . cycle ( ) . take ( 10000 ) ) ;
197197
198198 bencher
199- . with_inputs ( || ( packed. clone ( ) , indices. clone ( ) ) )
199+ . with_inputs ( || ( & packed, & indices) )
200200 . bench_refs ( |( packed, indices) | take ( packed. as_ref ( ) , indices. as_ref ( ) ) . unwrap ( ) )
201201}
202202
@@ -208,7 +208,7 @@ fn patched_take_200k_dispersed(bencher: Bencher) {
208208 let indices = PrimitiveArray :: from_iter ( ( 0 ..200_000 ) . map ( |i| ( i * 42 ) % values. len ( ) as u64 ) ) ;
209209
210210 bencher
211- . with_inputs ( || ( packed. clone ( ) , indices. clone ( ) ) )
211+ . with_inputs ( || ( & packed, & indices) )
212212 . bench_refs ( |( packed, indices) | take ( packed. as_ref ( ) , indices. as_ref ( ) ) . unwrap ( ) )
213213}
214214
@@ -220,7 +220,7 @@ fn patched_take_200k_first_chunk_only(bencher: Bencher) {
220220 let indices = PrimitiveArray :: from_iter ( ( 0 ..200_000 ) . map ( |i| ( ( i * 42 ) % 1024 ) as u64 ) ) ;
221221
222222 bencher
223- . with_inputs ( || ( packed. clone ( ) , indices. clone ( ) ) )
223+ . with_inputs ( || ( & packed, & indices) )
224224 . bench_refs ( |( packed, indices) | take ( packed. as_ref ( ) , indices. as_ref ( ) ) . unwrap ( ) )
225225}
226226
@@ -239,6 +239,6 @@ fn patched_take_10k_adversarial(bencher: Bencher) {
239239 ) ;
240240
241241 bencher
242- . with_inputs ( || ( packed. clone ( ) , indices. clone ( ) ) )
242+ . with_inputs ( || ( & packed, & indices) )
243243 . bench_refs ( |( packed, indices) | take ( packed. as_ref ( ) , indices. as_ref ( ) ) . unwrap ( ) )
244244}
0 commit comments