pyo3/benches/bench_pyobject.rs
David Hewitt fe57f64435 Improve performance on pointer drop
Co-Authored-By: Yuji Kanagawa <yuji.kngw.80s.revive@gmail.com>
2020-04-09 08:51:43 +01:00

17 lines
295 B
Rust

#![feature(test)]
extern crate test;
use pyo3::prelude::*;
use test::Bencher;
#[bench]
fn drop_many_objects(b: &mut Bencher) {
let gil = Python::acquire_gil();
let py = gil.python();
b.iter(|| {
for _ in 0..1000 {
std::mem::drop(py.None());
}
});
}