Skip to content

Commit

Permalink
fix: run benches against metered instance
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyg committed Jan 15, 2025
1 parent 5a8d2db commit 51d2ffb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test-crates/tests/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub fn wasm_instance(c: &mut Criterion) {
] {
group.bench_function(BenchmarkId::new("wasm_instance", wasm.name()), |b| {
b.iter(|| {
let _drop = wasm.unmetered_instance();
let _drop = wasm.instance();
});
});
}
Expand All @@ -96,7 +96,7 @@ pub fn wasm_instance(c: &mut Criterion) {
pub fn wasm_call(c: &mut Criterion) {
let mut group = c.benchmark_group("wasm_call");

let instance_with_store = TestWasm::Io.unmetered_instance();
let instance_with_store = TestWasm::Io.instance();

macro_rules! bench_call {
( $fs:expr; $t:tt; $n:ident; $build:expr; ) => {
Expand Down Expand Up @@ -162,7 +162,7 @@ pub fn wasm_call(c: &mut Criterion) {
pub fn wasm_call_n(c: &mut Criterion) {
let mut group = c.benchmark_group("wasm_call_n");

let instance_with_store = TestWasm::Io.unmetered_instance();
let instance_with_store = TestWasm::Io.instance();

macro_rules! bench_n {
( $fs:expr; $t:ty; ) => {
Expand Down Expand Up @@ -211,7 +211,7 @@ pub fn wasm_call_n(c: &mut Criterion) {
pub fn test_process_string(c: &mut Criterion) {
let mut group = c.benchmark_group("test_process_string");

let instance_with_store = TestWasm::Core.unmetered_instance();
let instance_with_store = TestWasm::Core.instance();

for n in [0, 1, 1_000, 1_000_000] {
group.throughput(Throughput::Bytes(n));
Expand Down Expand Up @@ -249,7 +249,7 @@ pub fn test_instances(c: &mut Criterion) {
let mut jhs = Vec::new();
for _ in 0..25 {
let input = input.clone();
let instance_with_store = TestWasm::Core.unmetered_instance();
let instance_with_store = TestWasm::Core.instance();
let instance = instance_with_store.instance.clone();
let store = instance_with_store.store.clone();
let jh = std::thread::spawn(move || {
Expand Down

0 comments on commit 51d2ffb

Please sign in to comment.