File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 5
5
#![ feature( trusted_random_access) ]
6
6
#![ feature( iter_array_chunks) ]
7
7
#![ feature( iter_next_chunk) ]
8
+ #![ feature( iter_advance_by) ]
8
9
9
10
extern crate test;
10
11
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ use std::str;
2
2
use test:: { black_box, Bencher } ;
3
3
4
4
mod char_count;
5
+ mod iter;
5
6
mod corpora;
6
7
7
8
#[ bench]
Original file line number Diff line number Diff line change
1
+ use super :: corpora;
2
+ use test:: { black_box, Bencher } ;
3
+
4
+
5
+
6
+ #[ bench]
7
+ fn chars_advance_by_1000 ( b : & mut Bencher ) {
8
+ b. iter ( || black_box ( corpora:: ru:: LARGE ) . chars ( ) . advance_by ( 1000 ) ) ;
9
+ }
10
+
11
+ #[ bench]
12
+ fn chars_advance_by_0010 ( b : & mut Bencher ) {
13
+ b. iter ( || black_box ( corpora:: ru:: LARGE ) . chars ( ) . advance_by ( 10 ) ) ;
14
+ }
15
+
16
+ #[ bench]
17
+ fn chars_advance_by_0001 ( b : & mut Bencher ) {
18
+ b. iter ( || black_box ( corpora:: ru:: LARGE ) . chars ( ) . advance_by ( 1 ) ) ;
19
+ }
20
+
You can’t perform that action at this time.
0 commit comments