From 7c3dd3398daff0ac9173239d64eee5b9dfd534c5 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 7 Mar 2022 13:41:42 -0600 Subject: [PATCH] Reduce benchmark runtime on CI (#3896) After adding the `call`-oriented benchmark recently I just noticed that running benchmarks on CI is taking 30+ minutes which is not intended. Instead of running a full benchmark run on CI (which I believe we're not looking at anyway) instead only run the benchmarks for a single iteration to ensure they still work but otherwise don't collect statistics about them. Additionally cap the number of parallel instantiations to 16 to avoid running tons of tests for machines with lots of cpus. --- .github/workflows/main.yml | 4 ++-- benches/instantiation.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7fb800c4207b..7e834ffd6108 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -360,8 +360,8 @@ jobs: - run: rustup target add wasm32-wasi - name: Install Rust run: rustup update stable && rustup default stable - - run: cargo bench - - run: cargo bench --features uffd + - run: cargo test --benches --release + - run: cargo test --benches --release --features uffd # Verify that cranelift's code generation is deterministic meta_determinist_check: diff --git a/benches/instantiation.rs b/benches/instantiation.rs index 2e919c4d8734..8ad3d2da22fb 100644 --- a/benches/instantiation.rs +++ b/benches/instantiation.rs @@ -86,7 +86,7 @@ fn bench_parallel(c: &mut Criterion, path: &Path) { (engine, pre) }); - for threads in 1..=num_cpus::get_physical() { + for threads in 1..=num_cpus::get_physical().min(16) { let name = format!( "{}: with {} thread{}", path.file_name().unwrap().to_str().unwrap(),