Merge pull request #3783 from davidhewitt/remove-pool-bench

remove bench of `GILPool::new`
This commit is contained in:
David Hewitt 2024-01-30 13:30:31 +00:00 committed by GitHub
commit c93073075b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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 pyo3::{prelude::*, GILPool};
fn bench_clean_gilpool_new(b: &mut Bencher<'_>) {
Python::with_gil(|_py| {
b.iter(|| {
let _ = unsafe { GILPool::new() };
});
});
}
use pyo3::prelude::*;
fn bench_clean_acquire_gil(b: &mut Bencher<'_>) {
// 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) {
c.bench_function("clean_gilpool_new", bench_clean_gilpool_new);
c.bench_function("clean_acquire_gil", bench_clean_acquire_gil);
c.bench_function("dirty_acquire_gil", bench_dirty_acquire_gil);
}