remove bench of `GILPool::new`

This commit is contained in:
David Hewitt 2024-01-30 11:45:06 +00:00
parent 718be9fac5
commit 0bb9de1aba
1 changed files with 1 additions and 10 deletions

View File

@ -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);
} }