File tree 3 files changed +19
-0
lines changed
3 files changed +19
-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 @@ -3,6 +3,7 @@ use test::{black_box, Bencher};
3
3
4
4
mod char_count;
5
5
mod corpora;
6
+ mod iter;
6
7
7
8
#[ bench]
8
9
fn str_validate_emoji ( b : & mut Bencher ) {
Original file line number Diff line number Diff line change
1
+ use super :: corpora;
2
+ use test:: { black_box, Bencher } ;
3
+
4
+ #[ bench]
5
+ fn chars_advance_by_1000 ( b : & mut Bencher ) {
6
+ b. iter ( || black_box ( corpora:: ru:: LARGE ) . chars ( ) . advance_by ( 1000 ) ) ;
7
+ }
8
+
9
+ #[ bench]
10
+ fn chars_advance_by_0010 ( b : & mut Bencher ) {
11
+ b. iter ( || black_box ( corpora:: ru:: LARGE ) . chars ( ) . advance_by ( 10 ) ) ;
12
+ }
13
+
14
+ #[ bench]
15
+ fn chars_advance_by_0001 ( b : & mut Bencher ) {
16
+ b. iter ( || black_box ( corpora:: ru:: LARGE ) . chars ( ) . advance_by ( 1 ) ) ;
17
+ }
You can’t perform that action at this time.
0 commit comments