File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use std::path::Path;
11
11
fn bench_cpython_code ( b : & mut Bencher , source : & str ) {
12
12
pyo3:: Python :: with_gil ( |py| {
13
13
b. iter ( || {
14
- let module = pyo3:: types:: PyModule :: from_code_bound ( py, source, "" , "" )
14
+ let module = pyo3:: types:: PyModule :: from_code ( py, source, "" , "" )
15
15
. expect ( "Error running source" ) ;
16
16
black_box ( module) ;
17
17
} )
@@ -53,7 +53,7 @@ pub fn benchmark_file_parsing(group: &mut BenchmarkGroup<WallTime>, name: &str,
53
53
group. bench_function ( BenchmarkId :: new ( "cpython" , name) , |b| {
54
54
use pyo3:: types:: PyAnyMethods ;
55
55
pyo3:: Python :: with_gil ( |py| {
56
- let builtins = pyo3:: types:: PyModule :: import_bound ( py, "builtins" )
56
+ let builtins = pyo3:: types:: PyModule :: import ( py, "builtins" )
57
57
. expect ( "Failed to import builtins" ) ;
58
58
let compile = builtins. getattr ( "compile" ) . expect ( "no compile in builtins" ) ;
59
59
b. iter ( || {
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ fn bench_cpython_code(group: &mut BenchmarkGroup<WallTime>, bench: &MicroBenchma
45
45
46
46
// Grab the exec function in advance so we don't have lookups in the hot code
47
47
let builtins =
48
- pyo3:: types:: PyModule :: import_bound ( py, "builtins" ) . expect ( "Failed to import builtins" ) ;
48
+ pyo3:: types:: PyModule :: import ( py, "builtins" ) . expect ( "Failed to import builtins" ) ;
49
49
let exec = builtins. getattr ( "exec" ) . expect ( "no exec in builtins" ) ;
50
50
51
51
let bench_func = |( globals, locals) : & mut (
@@ -99,7 +99,7 @@ fn cpy_compile_code<'a>(
99
99
name : & str ,
100
100
) -> pyo3:: PyResult < pyo3:: Bound < ' a , pyo3:: types:: PyCode > > {
101
101
let builtins =
102
- pyo3:: types:: PyModule :: import_bound ( py, "builtins" ) . expect ( "Failed to import builtins" ) ;
102
+ pyo3:: types:: PyModule :: import ( py, "builtins" ) . expect ( "Failed to import builtins" ) ;
103
103
let compile = builtins. getattr ( "compile" ) . expect ( "no compile in builtins" ) ;
104
104
compile. call1 ( ( code, name, "exec" ) ) ?. extract ( )
105
105
}
You can’t perform that action at this time.
0 commit comments