@@ -16,9 +16,7 @@ limitations under the License.
1616
1717use criterion:: { Criterion , criterion_group, criterion_main} ;
1818use hyperlight_host:: GuestBinary ;
19- use hyperlight_host:: sandbox:: {
20- Callable , MultiUseSandbox , SandboxConfiguration , UninitializedSandbox ,
21- } ;
19+ use hyperlight_host:: sandbox:: { MultiUseSandbox , SandboxConfiguration , UninitializedSandbox } ;
2220use hyperlight_testing:: simple_guest_as_string;
2321
2422fn create_uninit_sandbox ( ) -> UninitializedSandbox {
@@ -38,7 +36,7 @@ fn guest_call_benchmark(c: &mut Criterion) {
3836 group. bench_function ( "guest_call" , |b| {
3937 let mut sbox = create_multiuse_sandbox ( ) ;
4038
41- b. iter ( || sbox. call :: < String > ( "Echo" , "hello\n " . to_string ( ) ) . unwrap ( ) ) ;
39+ b. iter ( || sbox. run :: < String > ( "Echo" , "hello\n " . to_string ( ) ) . unwrap ( ) ) ;
4240 } ) ;
4341
4442 // Benchmarks a single guest function call.
@@ -48,7 +46,7 @@ fn guest_call_benchmark(c: &mut Criterion) {
4846 let snapshot = sbox. snapshot ( ) . unwrap ( ) ;
4947
5048 b. iter ( || {
51- sbox. call :: < String > ( "Echo" , "hello\n " . to_string ( ) ) . unwrap ( ) ;
49+ sbox. run :: < String > ( "Echo" , "hello\n " . to_string ( ) ) . unwrap ( ) ;
5250 sbox. restore ( & snapshot) . unwrap ( ) ;
5351 } ) ;
5452 } ) ;
@@ -65,11 +63,7 @@ fn guest_call_benchmark(c: &mut Criterion) {
6563
6664 let mut multiuse_sandbox: MultiUseSandbox = uninitialized_sandbox. evolve ( ) . unwrap ( ) ;
6765
68- b. iter ( || {
69- multiuse_sandbox
70- . call :: < i32 > ( "Add" , ( 1_i32 , 41_i32 ) )
71- . unwrap ( )
72- } ) ;
66+ b. iter ( || multiuse_sandbox. run :: < i32 > ( "Add" , ( 1_i32 , 41_i32 ) ) . unwrap ( ) ) ;
7367 } ) ;
7468
7569 group. finish ( ) ;
@@ -99,10 +93,7 @@ fn guest_call_benchmark_large_param(c: &mut Criterion) {
9993
10094 b. iter ( || {
10195 sandbox
102- . call_guest_function_by_name :: < ( ) > (
103- "LargeParameters" ,
104- ( large_vec. clone ( ) , large_string. clone ( ) ) ,
105- )
96+ . run :: < ( ) > ( "LargeParameters" , ( large_vec. clone ( ) , large_string. clone ( ) ) )
10697 . unwrap ( )
10798 } ) ;
10899 } ) ;
0 commit comments