Skip to content

Commit

Permalink
fix bench
Browse files Browse the repository at this point in the history
  • Loading branch information
thedavidmeister committed Nov 6, 2023
1 parent bf3b660 commit 346abcd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions test/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,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.instance();
let instance_with_store = TestWasm::Io.unmetered_instance();

macro_rules! bench_n {
( $fs:expr; $t:ty; ) => {
Expand Down Expand Up @@ -165,7 +165,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::Test.instance();
let instance_with_store = TestWasm::Test.unmetered_instance();

for n in vec![0, 1, 1_000, 1_000_000] {
group.throughput(Throughput::Bytes(n));
Expand Down
30 changes: 16 additions & 14 deletions test/src/wasms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,22 @@ impl TestWasm {
.get_typed_function(&store_mut, "__hc__allocate_1")
.unwrap(),
);
data_mut.wasmer_metering_points_exhausted = Some(
instance
.exports
.get_global("wasmer_metering_points_exhausted")
.unwrap()
.clone(),
);
data_mut.wasmer_metering_remaining_points = Some(
instance
.exports
.get_global("wasmer_metering_remaining_points")
.unwrap()
.clone(),
);
if metered {
data_mut.wasmer_metering_points_exhausted = Some(
instance
.exports
.get_global("wasmer_metering_points_exhausted")
.unwrap()
.clone(),
);
data_mut.wasmer_metering_remaining_points = Some(
instance
.exports
.get_global("wasmer_metering_remaining_points")
.unwrap()
.clone(),
);
}
}

InstanceWithStore {
Expand Down

0 comments on commit 346abcd

Please sign in to comment.