File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/hyperlight_host/benches Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,15 @@ fn guest_call_benchmark(c: &mut Criterion) {
43
43
44
44
// Benchmarks a single guest function call.
45
45
// 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 ( ) ;
48
49
49
50
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 ( ) ;
53
55
} ) ;
54
56
} ) ;
55
57
You can’t perform that action at this time.
0 commit comments