Skip to content

Commit

Permalink
Add benchmark before trying lowercase fields
Browse files Browse the repository at this point in the history
  • Loading branch information
fsktom committed Aug 21, 2024
1 parent 0251a09 commit c0c38e4
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions benches/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,30 @@ fn kekw(c: &mut Criterion) {

#[allow(dead_code)]
fn parse(c: &mut Criterion) {
let paths = paths(0, 9);
let paths = paths(0, 0);

c.bench_function("parse", |c| {
c.iter(|| {
black_box(SongEntries::new(&paths[..=0]).unwrap());
})
});
// c.bench_function("parse", |c| {
// c.iter(|| {
// black_box(SongEntries::new(&paths).unwrap());
// })
// });

// c.bench_function("parse and filter", |c| {
// c.iter(|| {
// black_box(
// SongEntries::new(&paths)
// .unwrap()
// .filter(30, TimeDelta::seconds(10)),
// );
// })
// });

c.bench_function("parse and filter", |c| {
c.bench_function("parse, sum and filter", |c| {
c.iter(|| {
black_box(
SongEntries::new(&paths[..=0])
SongEntries::new(&paths)
.unwrap()
.sum_different_capitalization()
.filter(30, TimeDelta::seconds(10)),
);
})
Expand Down Expand Up @@ -179,7 +190,7 @@ fn gather(c: &mut Criterion) {
black_box(gather::albums(&entries));
})
});
c.bench_function("gather songs", |c| {
c.bench_function("gather songs summed across albums", |c| {
c.iter(|| {
black_box(gather::songs_summed_across_albums(&entries));
})
Expand Down Expand Up @@ -274,9 +285,9 @@ fn find(c: &mut Criterion) {

// criterion_group!(benches, lol);
// criterion_group!(benches, kekw);
// criterion_group!(benches, parse);
criterion_group!(benches, parse);
// criterion_group!(benches, unique_sum);
// criterion_group!(benches, gather);
// criterion_group!(benches, capitalization);
criterion_group!(benches, find);
// criterion_group!(benches, find);
criterion_main!(benches);

0 comments on commit c0c38e4

Please sign in to comment.