@@ -16,9 +16,7 @@ limitations under the License.
16
16
17
17
use criterion:: { Criterion , criterion_group, criterion_main} ;
18
18
use hyperlight_host:: GuestBinary ;
19
- use hyperlight_host:: sandbox:: {
20
- Callable , MultiUseSandbox , SandboxConfiguration , UninitializedSandbox ,
21
- } ;
19
+ use hyperlight_host:: sandbox:: { MultiUseSandbox , SandboxConfiguration , UninitializedSandbox } ;
22
20
use hyperlight_testing:: simple_guest_as_string;
23
21
24
22
fn create_uninit_sandbox ( ) -> UninitializedSandbox {
@@ -38,7 +36,7 @@ fn guest_call_benchmark(c: &mut Criterion) {
38
36
group. bench_function ( "guest_call" , |b| {
39
37
let mut sbox = create_multiuse_sandbox ( ) ;
40
38
41
- b. iter ( || sbox. call :: < String > ( "Echo" , "hello\n " . to_string ( ) ) . unwrap ( ) ) ;
39
+ b. iter ( || sbox. run :: < String > ( "Echo" , "hello\n " . to_string ( ) ) . unwrap ( ) ) ;
42
40
} ) ;
43
41
44
42
// Benchmarks a single guest function call.
@@ -48,7 +46,7 @@ fn guest_call_benchmark(c: &mut Criterion) {
48
46
let snapshot = sbox. snapshot ( ) . unwrap ( ) ;
49
47
50
48
b. iter ( || {
51
- sbox. call :: < String > ( "Echo" , "hello\n " . to_string ( ) ) . unwrap ( ) ;
49
+ sbox. run :: < String > ( "Echo" , "hello\n " . to_string ( ) ) . unwrap ( ) ;
52
50
sbox. restore ( & snapshot) . unwrap ( ) ;
53
51
} ) ;
54
52
} ) ;
@@ -65,11 +63,7 @@ fn guest_call_benchmark(c: &mut Criterion) {
65
63
66
64
let mut multiuse_sandbox: MultiUseSandbox = uninitialized_sandbox. evolve ( ) . unwrap ( ) ;
67
65
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 ( ) ) ;
73
67
} ) ;
74
68
75
69
group. finish ( ) ;
@@ -99,10 +93,7 @@ fn guest_call_benchmark_large_param(c: &mut Criterion) {
99
93
100
94
b. iter ( || {
101
95
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 ( ) ) )
106
97
. unwrap ( )
107
98
} ) ;
108
99
} ) ;
0 commit comments