Skip to content

Commit

Permalink
fix benchmark
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
  • Loading branch information
jprendes committed Dec 20, 2024
1 parent 6842cee commit 1082ac4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 1082ac4

Please sign in to comment.