2020-05-20 22:51:56 -04:00
|
|
|
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
|
|
|
|
|
|
|
pub fn many_hsla(c: &mut Criterion) {
|
|
|
|
c.bench_function("many_hsla", |b| {
|
2020-08-01 12:12:37 +08:00
|
|
|
b.iter(|| {
|
|
|
|
grass::from_string(
|
|
|
|
black_box(include_str!("many_hsla.scss").to_string()),
|
|
|
|
&Default::default(),
|
|
|
|
)
|
|
|
|
})
|
2020-05-20 22:51:56 -04:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn many_named_colors(c: &mut Criterion) {
|
|
|
|
c.bench_function("many_named_colors", |b| {
|
|
|
|
b.iter(|| {
|
2020-08-01 12:12:37 +08:00
|
|
|
grass::from_string(
|
|
|
|
black_box(include_str!("many_named_colors.scss").to_string()),
|
|
|
|
&Default::default(),
|
|
|
|
)
|
2020-05-20 22:51:56 -04:00
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
criterion_group!(benches, many_hsla, many_named_colors,);
|
|
|
|
criterion_main!(benches);
|