File tree Expand file tree Collapse file tree
src/hyperlight_host/benches Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -379,11 +379,10 @@ fn guest_call_benchmark_large_param(c: &mut Criterion) {
379379 #[ cfg( target_os = "windows" ) ]
380380 group. sample_size ( 10 ) ; // This benchmark is very slow on Windows, so we reduce the sample size to avoid long test runs.
381381
382- // This benchmark includes time to first clone a vector and string, so it is not a "pure' benchmark of the guest call, but it's still useful
383382 group. bench_function ( "guest_call_with_large_parameters" , |b| {
384383 const SIZE : usize = 50 * 1024 * 1024 ; // 50 MB
385384 let large_vec = vec ! [ 0u8 ; SIZE ] ;
386- let large_string = unsafe { String :: from_utf8_unchecked ( large_vec. clone ( ) ) } ; // Safety: indeed above vec is valid utf8
385+ let large_string = String :: from_utf8 ( large_vec. clone ( ) ) . unwrap ( ) ;
387386
388387 let mut config = SandboxConfiguration :: default ( ) ;
389388 config. set_input_data_size ( 2 * SIZE + ( 1024 * 1024 ) ) ; // 2 * SIZE + 1 MB, to allow 1MB for the rest of the serialized function call
You can’t perform that action at this time.
0 commit comments