feat: add some benches to compare with linicon
This commit is contained in:
parent
6515a02881
commit
e40fbfa916
6 changed files with 124 additions and 62 deletions
17
benches/simple_lookup.rs
Normal file
17
benches/simple_lookup.rs
Normal 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);
|
||||
Loading…
Add table
Add a link
Reference in a new issue