Skip to content

Commit a50b91b

Browse files
committed
Make benchmark work with act, and fix import
This doesn't remedy a certain benchmark's possible memory consumption.
1 parent c128229 commit a50b91b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.github/workflows/cron-ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ jobs:
124124
runs-on: ubuntu-latest
125125
steps:
126126
- uses: actions/checkout@v2
127+
- uses: actions-rs/toolchain@v1
127128
- run: cargo install cargo-criterion
128129
- name: build benchmarks
129130
run: cargo build --release --benches

benches/microbenchmarks.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,13 @@ fn bench_rustpy_code(group: &mut BenchmarkGroup<WallTime>, bench: &MicroBenchmar
114114
settings.dont_write_bytecode = true;
115115
settings.no_user_site = true;
116116

117-
Interpreter::new(settings, InitParameter::External).enter(|vm| {
117+
Interpreter::new_with_init(settings, |vm| {
118+
for (name, init) in rustpython_stdlib::get_module_inits().into_iter() {
119+
vm.add_native_module(name, init);
120+
}
121+
InitParameter::External
122+
})
123+
.enter(|vm| {
118124
let setup_code = vm
119125
.compile(&bench.setup, Mode::Exec, bench.name.to_owned())
120126
.expect("Error compiling setup code");

0 commit comments

Comments
 (0)