@@ -17,7 +17,6 @@ limitations under the License.
17
17
use std:: time:: Duration ;
18
18
19
19
use criterion:: { criterion_group, criterion_main, Criterion } ;
20
- use hyperlight_common:: flatbuffer_wrappers:: function_types:: { ParameterValue , ReturnType } ;
21
20
use hyperlight_host:: sandbox:: { MultiUseSandbox , SandboxConfiguration , UninitializedSandbox } ;
22
21
use hyperlight_host:: sandbox_state:: sandbox:: EvolvableSandbox ;
23
22
use hyperlight_host:: sandbox_state:: transition:: Noop ;
@@ -41,15 +40,7 @@ fn guest_call_benchmark(c: &mut Criterion) {
41
40
group. bench_function ( "guest_call" , |b| {
42
41
let mut call_ctx = create_multiuse_sandbox ( ) . new_call_context ( ) ;
43
42
44
- b. iter ( || {
45
- call_ctx
46
- . call (
47
- "Echo" ,
48
- ReturnType :: Int ,
49
- Some ( vec ! [ ParameterValue :: String ( "hello\n " . to_string( ) ) ] ) ,
50
- )
51
- . unwrap ( )
52
- } ) ;
43
+ b. iter ( || call_ctx. call :: < i32 > ( "Echo" , "hello\n " . to_string ( ) ) . unwrap ( ) ) ;
53
44
} ) ;
54
45
55
46
// Benchmarks a single guest function call.
@@ -59,11 +50,7 @@ fn guest_call_benchmark(c: &mut Criterion) {
59
50
60
51
b. iter ( || {
61
52
sandbox
62
- . call_guest_function_by_name (
63
- "Echo" ,
64
- ReturnType :: Int ,
65
- Some ( vec ! [ ParameterValue :: String ( "hello\n " . to_string( ) ) ] ) ,
66
- )
53
+ . call_guest_function_by_name :: < i32 > ( "Echo" , "hello\n " . to_string ( ) )
67
54
. unwrap ( )
68
55
} ) ;
69
56
} ) ;
@@ -89,13 +76,9 @@ fn guest_call_benchmark(c: &mut Criterion) {
89
76
90
77
b. iter ( || {
91
78
sandbox
92
- . call_guest_function_by_name (
79
+ . call_guest_function_by_name :: < ( ) > (
93
80
"LargeParameters" ,
94
- ReturnType :: Void ,
95
- Some ( vec ! [
96
- ParameterValue :: VecBytes ( large_vec. clone( ) ) ,
97
- ParameterValue :: String ( large_string. clone( ) ) ,
98
- ] ) ,
81
+ ( large_vec. clone ( ) , large_string. clone ( ) ) ,
99
82
)
100
83
. unwrap ( )
101
84
} ) ;
@@ -115,15 +98,7 @@ fn guest_call_benchmark(c: &mut Criterion) {
115
98
uninitialized_sandbox. evolve ( Noop :: default ( ) ) . unwrap ( ) ;
116
99
let mut call_ctx = multiuse_sandbox. new_call_context ( ) ;
117
100
118
- b. iter ( || {
119
- call_ctx
120
- . call (
121
- "Add" ,
122
- ReturnType :: Int ,
123
- Some ( vec ! [ ParameterValue :: Int ( 1 ) , ParameterValue :: Int ( 41 ) ] ) ,
124
- )
125
- . unwrap ( )
126
- } ) ;
101
+ b. iter ( || call_ctx. call :: < i32 > ( "Add" , ( 1_i32 , 41_i32 ) ) . unwrap ( ) ) ;
127
102
} ) ;
128
103
129
104
group. finish ( ) ;
0 commit comments