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 55#![ feature( trusted_random_access) ]
66#![ feature( iter_array_chunks) ]
77#![ feature( iter_next_chunk) ]
8+ #![ feature( iter_advance_by) ]
89
910extern crate test;
1011
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ use std::str;
22use test:: { black_box, Bencher } ;
33
44mod char_count;
5+ mod iter;
56mod corpora;
67
78#[ 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