remove bench of `GILPool::new`
This commit is contained in:
parent
718be9fac5
commit
0bb9de1aba
|
@ -1,14 +1,6 @@
|
||||||
use codspeed_criterion_compat::{criterion_group, criterion_main, BatchSize, Bencher, Criterion};
|
use codspeed_criterion_compat::{criterion_group, criterion_main, BatchSize, Bencher, Criterion};
|
||||||
|
|
||||||
use pyo3::{prelude::*, GILPool};
|
use pyo3::prelude::*;
|
||||||
|
|
||||||
fn bench_clean_gilpool_new(b: &mut Bencher<'_>) {
|
|
||||||
Python::with_gil(|_py| {
|
|
||||||
b.iter(|| {
|
|
||||||
let _ = unsafe { GILPool::new() };
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
fn bench_clean_acquire_gil(b: &mut Bencher<'_>) {
|
fn bench_clean_acquire_gil(b: &mut Bencher<'_>) {
|
||||||
// Acquiring first GIL will also create a "clean" GILPool, so this measures the Python overhead.
|
// Acquiring first GIL will also create a "clean" GILPool, so this measures the Python overhead.
|
||||||
|
@ -28,7 +20,6 @@ fn bench_dirty_acquire_gil(b: &mut Bencher<'_>) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn criterion_benchmark(c: &mut Criterion) {
|
fn criterion_benchmark(c: &mut Criterion) {
|
||||||
c.bench_function("clean_gilpool_new", bench_clean_gilpool_new);
|
|
||||||
c.bench_function("clean_acquire_gil", bench_clean_acquire_gil);
|
c.bench_function("clean_acquire_gil", bench_clean_acquire_gil);
|
||||||
c.bench_function("dirty_acquire_gil", bench_dirty_acquire_gil);
|
c.bench_function("dirty_acquire_gil", bench_dirty_acquire_gil);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue