Make benchmark work with act, and fix import

This doesn't remedy a certain benchmark's possible memory consumption.
This commit is contained in:
Padraic Fanning committed 2021-10-24 01:47:12 -04:00
1 parent c1282293f8
commit a50b91bb0e
2 files changed
+8 -1

No files matched your search

+1
View File
@@ -124,6 +124,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- run: cargo install cargo-criterion
- name: build benchmarks
run: cargo build --release --benches
+7 -1
View File
@@ -114,7 +114,13 @@ fn bench_rustpy_code(group: &mut BenchmarkGroup<WallTime>, bench: &MicroBenchmar
settings.dont_write_bytecode = true;
settings.no_user_site = true;
Interpreter::new(settings, InitParameter::External).enter(|vm| {
Interpreter::new_with_init(settings, |vm| {
for (name, init) in rustpython_stdlib::get_module_inits().into_iter() {
vm.add_native_module(name, init);
}
InitParameter::External
})
.enter(|vm| {
let setup_code = vm
.compile(&bench.setup, Mode::Exec, bench.name.to_owned())
.expect("Error compiling setup code");