mv std libs to library/
This commit is contained in:
parent
9be8ffcb02
commit
2c31b45ae8
875 changed files with 1255 additions and 1223 deletions
42
library/core/benches/pattern.rs
Normal file
42
library/core/benches/pattern.rs
Normal file
|
@ -0,0 +1,42 @@
|
|||
use test::black_box;
|
||||
use test::Bencher;
|
||||
|
||||
#[bench]
|
||||
fn starts_with_char(b: &mut Bencher) {
|
||||
let text = black_box("kdjsfhlakfhlsghlkvcnljknfqiunvcijqenwodind");
|
||||
b.iter(|| {
|
||||
for _ in 0..1024 {
|
||||
black_box(text.starts_with('k'));
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn starts_with_str(b: &mut Bencher) {
|
||||
let text = black_box("kdjsfhlakfhlsghlkvcnljknfqiunvcijqenwodind");
|
||||
b.iter(|| {
|
||||
for _ in 0..1024 {
|
||||
black_box(text.starts_with("k"));
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn ends_with_char(b: &mut Bencher) {
|
||||
let text = black_box("kdjsfhlakfhlsghlkvcnljknfqiunvcijqenwodind");
|
||||
b.iter(|| {
|
||||
for _ in 0..1024 {
|
||||
black_box(text.ends_with('k'));
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn ends_with_str(b: &mut Bencher) {
|
||||
let text = black_box("kdjsfhlakfhlsghlkvcnljknfqiunvcijqenwodind");
|
||||
b.iter(|| {
|
||||
for _ in 0..1024 {
|
||||
black_box(text.ends_with("k"));
|
||||
}
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue