File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-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 @@ -3,6 +3,7 @@ use test::{black_box, Bencher};
33
44mod char_count;
55mod corpora;
6+ mod iter;
67
78#[ bench]
89fn 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