feat: add some benches to compare with linicon

This commit is contained in:
Paul Delafosse 2022-05-12 15:34:02 +02:00
parent 6515a02881
commit e40fbfa916
6 changed files with 124 additions and 62 deletions

17
benches/simple_lookup.rs Normal file
View file

@ -0,0 +1,17 @@
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use freedesktop_icons::lookup;
pub fn simple_lookup(c: &mut Criterion) {
c.bench_function("lookup firefox", |b| {
b.iter(|| lookup("firefox").find_one())
});
}
pub fn simple_lookup_linicon(c: &mut Criterion) {
c.bench_function("lookup firefox linicon", |b| {
b.iter(|| linicon::lookup_icon("firefox").next().unwrap().unwrap())
});
}
criterion_group!(benches, simple_lookup, simple_lookup_linicon);
criterion_main!(benches);