[go: up one dir, main page]

pyo3 0.12.1

Bindings to Python interpreter
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![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());
        }
    });
}