benchmarks for Chars::advance_by
This commit is contained in:
parent
1bcbb7c93b
commit
3f55e8665c
@ -5,6 +5,7 @@
|
|||||||
#![feature(trusted_random_access)]
|
#![feature(trusted_random_access)]
|
||||||
#![feature(iter_array_chunks)]
|
#![feature(iter_array_chunks)]
|
||||||
#![feature(iter_next_chunk)]
|
#![feature(iter_next_chunk)]
|
||||||
|
#![feature(iter_advance_by)]
|
||||||
|
|
||||||
extern crate test;
|
extern crate test;
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
mod char_count;
|
mod char_count;
|
||||||
mod corpora;
|
mod corpora;
|
||||||
|
mod iter;
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
fn str_validate_emoji(b: &mut Bencher) {
|
fn str_validate_emoji(b: &mut Bencher) {
|
||||||
|
17
library/core/benches/str/iter.rs
Normal file
17
library/core/benches/str/iter.rs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
use super::corpora;
|
||||||
|
use test::{black_box, Bencher};
|
||||||
|
|
||||||
|
#[bench]
|
||||||
|
fn chars_advance_by_1000(b: &mut Bencher) {
|
||||||
|
b.iter(|| black_box(corpora::ru::LARGE).chars().advance_by(1000));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[bench]
|
||||||
|
fn chars_advance_by_0010(b: &mut Bencher) {
|
||||||
|
b.iter(|| black_box(corpora::ru::LARGE).chars().advance_by(10));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[bench]
|
||||||
|
fn chars_advance_by_0001(b: &mut Bencher) {
|
||||||
|
b.iter(|| black_box(corpora::ru::LARGE).chars().advance_by(1));
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user