(c: &mut Criterion)
| 19 | } |
| 20 | |
| 21 | fn extract_failure(c: &mut Criterion) { |
| 22 | Python::attach(|py| { |
| 23 | let any = PyArray2::<i32>::zeros(py, (10, 10), false).into_any(); |
| 24 | |
| 25 | c.bench_function("extract_failure", |b| { |
| 26 | b.iter(|| { |
| 27 | black_box(&any) |
| 28 | .extract::<Bound<'_, PyArray2<f64>>>() |
| 29 | .unwrap_err() |
| 30 | }); |
| 31 | }); |
| 32 | }); |
| 33 | } |
| 34 | |
| 35 | fn cast_success(c: &mut Criterion) { |
| 36 | Python::attach(|py| { |