/// Benchmark encoding a FIDL struct containing a single uint64 field
Benchmark encoding a FIDL struct containing a single uint64 field
Benchmark encoding a FIDL struct containing a single uint64 field
fn int64struct_encode(b: &mut Bencher) {
    b.iter_batched(
        || {
            let buffer: Vec<u8> = Vec::with_capacity(1024);
            let handles: Vec<Handle> = Vec::new();
            let value = Int64Struct { x: 0x0102030405060708 };
            (buffer, handles, value)
        },
        |test_data| {
            let (mut buffer, mut handles, mut value) = test_data;
            Encoder::encode_with_context(V1_CONTEXT, &mut buffer, &mut handles, &mut value)
                .unwrap();
        },
        BatchSize::SmallInput,
    );
}
fn int64struct_encode ( b : & mut Bencher ) { b . iter_batched ( | | { let buffer : Vec < u8 > = Vec :: with_capacity ( 1024 ) ; let handles : Vec < Handle > = Vec :: new ( ) ; let value = Int64Struct { x : 0x0102030405060708 } ; ( buffer , handles , value ) } , | test_data | { let ( mut buffer , mut handles , mut value ) = test_data ; Encoder :: encode_with_context ( V1_CONTEXT , & mut buffer , & mut handles , & mut value ) . unwrap ( ) ; } , BatchSize :: SmallInput , ) ; }
Benchmark encoding a FIDL struct containing a single uint64 field
Benchmark encoding a FIDL struct containing a single uint64 field
b
&mut Bencher