Skip to content

Commit

Permalink
fix benchmark
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Prendes <[email protected]>
  • Loading branch information
jprendes committed Dec 20, 2024
1 parent f2ca823 commit d26416d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
1 change: 0 additions & 1 deletion benches/containerd-shim-benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ edition.workspace = true
containerd-shim-wasm = { path = "../../crates/containerd-shim-wasm", features = ["testing"] }
containerd-shim-wasmedge = { path = "../../crates/containerd-shim-wasmedge" }
containerd-shim-wasmtime = { path = "../../crates/containerd-shim-wasmtime" }
wasmtime = { workspace = true }

[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
Expand Down
17 changes: 2 additions & 15 deletions benches/containerd-shim-benchmarks/benches/wasmtime-benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::time::Duration;
use containerd_shim_wasm::container::Instance;
use containerd_shim_wasm::sandbox::Error;
use containerd_shim_wasm::testing::WasiTest;
use containerd_shim_wasmtime::instance::{WasiConfig, WasmtimeEngine};
use containerd_shim_wasmtime::instance::WasmtimeEngine;
use criterion::measurement::WallTime;
use criterion::{criterion_group, criterion_main, BenchmarkGroup, Criterion};

Expand Down Expand Up @@ -53,21 +53,8 @@ use criterion::{criterion_group, criterion_main, BenchmarkGroup, Criterion};
of a longer benchmarking time). Running the whole suite on a desktop
computer takes now a bit over 10 minutes.
*/
#[derive(Clone)]
struct WasiTestConfig {}

impl WasiConfig for WasiTestConfig {
fn new_config() -> wasmtime::Config {
let mut config = wasmtime::Config::new();
// Disable Wasmtime parallel compilation for the tests
// see https://github.com/containerd/runwasi/pull/405#issuecomment-1928468714 for details
config.parallel_compilation(false);
config.wasm_component_model(true); // enable component linking
config
}
}

type WasmtimeTestInstance = Instance<WasmtimeEngine<WasiTestConfig>>;
type WasmtimeTestInstance = Instance<WasmtimeEngine>;

fn run_wasmtime_test_with_spec(wasmbytes: &[u8]) -> Result<u32, Error> {
let (exit_code, _, _) = WasiTest::<WasmtimeTestInstance>::builder()?
Expand Down

0 comments on commit d26416d

Please sign in to comment.