Skip to content

Commit f87f6f4

Browse files
committed
fix benchmark to new API
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
1 parent 9d9f96e commit f87f6f4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/hyperlight_host/benches/benchmarks.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ fn guest_call_benchmark(c: &mut Criterion) {
4343

4444
// Benchmarks a single guest function call.
4545
// The benchmark does include the time to reset the sandbox memory after the call.
46-
group.bench_function("guest_call_with_reset", |b| {
47-
let mut sandbox = create_multiuse_sandbox();
46+
group.bench_function("guest_call_with_restore", |b| {
47+
let mut sbox = create_multiuse_sandbox();
48+
let snapshot = sbox.snapshot().unwrap();
4849

4950
b.iter(|| {
50-
sandbox
51-
.call_guest_function_by_name::<String>("Echo", "hello\n".to_string())
52-
.unwrap()
51+
sbox
52+
.call::<String>("Echo", "hello\n".to_string())
53+
.unwrap();
54+
sbox.restore(&snapshot).unwrap();
5355
});
5456
});
5557

0 commit comments

Comments
 (0)