24 lines
659 B
Rust
24 lines
659 B
Rust
#[macro_use]
|
|
extern crate criterion;
|
|
extern crate adversary;
|
|
|
|
use criterion::{criterion_group, criterion_main, Criterion};
|
|
|
|
fn bench_search_big(c: &mut Criterion) {
|
|
pyo3::prepare_freethreaded_python();
|
|
pyo3::Python::with_gil(|_py| {
|
|
let obj = adversary::Prover::py_new(
|
|
"= (ham x) k".to_string(),
|
|
"= (ham y) (+ k 1)".to_string(),
|
|
"<= ham (^ x y) p".to_string(),
|
|
)
|
|
.unwrap();
|
|
c.bench_function("search_big", |b| {
|
|
b.iter(|| criterion::black_box(obj.find_bounds(12, 5, 8)));
|
|
});
|
|
})
|
|
}
|
|
|
|
criterion_group!(search_big, bench_search_big);
|
|
criterion_main!(search_big);
|