Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic in drop #756

Open
rbtcollins opened this issue Feb 8, 2024 · 0 comments
Open

panic in drop #756

rbtcollins opened this issue Feb 8, 2024 · 0 comments

Comments

@rbtcollins
Copy link

Getting this:

 16:     0x562eb027aaf3 - core::result::unwrap_failed::hddb4fea594200c52
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/result.rs:1653:5
  17:     0x562eb0290a0d - <criterion::benchmark_group::BenchmarkGroup<M> as core::ops::drop::Drop>::drop::he08f359ac432fea0
  18:     0x562eb02a2fe1 - core::ptr::drop_in_place<criterion::benchmark_group::BenchmarkGroup<criterion::measurement::WallTime>>::h6738354a2f13e3af
  19:     0x562eb02a64aa - routelookups::main::he1be34487cdda972

Presumably I'm doing something strange, but its not obvious what it is :)

benchmark code looks something like:

pub fn criterion_benchmark(c: &mut Criterion) {
   
    let die = Uniform::from(0..10);
    let mut cases = vec![];

    for scale in [
        1, 10, 100, 1_000, 10_000, 100_000, 1_000_000, 
    ] {
        // ... create a data structure of that scale
        let table = ...
        let paths = Vec::from([...])
        cases.push((scale, paths, table));
    }

    let mut group = c.benchmark_group("lookups");
    for (size, paths, table) in cases.iter() {
        let mut paths = paths.iter().cycle();
        group.throughput(Throughput::Elements(*size as u64));
        if *size > 100_000 {
            group.measurement_time(Duration::from_secs(10));
        }
        group.bench_with_input(
            BenchmarkId::from_parameter(format!("{REPS}_lookups_in_{size}_table")),
            size,
            |b, &_size| {
                b.iter(|| {
                    // REPS lookups in each datastructure
                    for _ in 0..REPS {
                        lookup_route(black_box(table), black_box(paths.next().unwrap()));
                    }
                })
            },
        );
    }
    group.finish();
}

criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant