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) {
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
You can’t perform that action at this time.
0 commit comments