diff --git a/Cargo.toml b/Cargo.toml index 083358cf749..6c29f67e03b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,6 +54,7 @@ rustyline = { workspace = true } [dev-dependencies] criterion = { workspace = true } pyo3 = { version = "0.27", features = ["auto-initialize"] } +rustpython-stdlib = { workspace = true } [[bench]] name = "execution" diff --git a/benches/execution.rs b/benches/execution.rs index c2239b59d12..bf1bcfcc3db 100644 --- a/benches/execution.rs +++ b/benches/execution.rs @@ -24,7 +24,10 @@ fn bench_rustpython_code(b: &mut Bencher, name: &str, source: &str) { settings.path_list.push("Lib/".to_string()); settings.write_bytecode = false; settings.user_site_directory = false; - Interpreter::without_stdlib(settings).enter(|vm| { + Interpreter::with_init(settings, |vm| { + vm.add_native_modules(rustpython_stdlib::get_module_inits()); + }) + .enter(|vm| { // Note: bench_cpython is both compiling and executing the code. // As such we compile the code in the benchmark loop as well. b.iter(|| {