mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Make benchmark work with act, and fix import
This doesn't remedy a certain benchmark's possible memory consumption.
This commit is contained in:
2 files changed
+8
-1
No files matched your search
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user