1
0
Fork 0
mirror of https://codeberg.org/icewind/bitbuffer.git synced 2026-06-03 16:44:06 +02:00

bench groups

This commit is contained in:
Robin Appelman 2025-07-14 16:39:42 +02:00
commit b054ca2595

View file

@ -120,6 +120,7 @@ fn perf_string<E: Endianness>((offset, buffer): (usize, BitReadBuffer<E>)) {
black_box(result);
}
}
#[library_benchmark(setup = build_string_buffer)]
#[bench::le_alligned(0, LittleEndian)]
#[bench::be_alligned(0, BigEndian)]
@ -183,8 +184,30 @@ fn perf_struct<E: Endianness, Struct: BitRead<'static, E>>(
}
library_benchmark_group!(
name = bench_read_group;
benchmarks = read_perf, perf_bool, perf_bytes, perf_f32, perf_f64, perf_string, perf_struct
name = bench_read_primitives;
benchmarks = read_perf, perf_bool, perf_f32, perf_f64
);
main!(library_benchmark_groups = bench_read_group);
library_benchmark_group!(
name = bench_read_string;
compare_by_id = true;
benchmarks = perf_string
);
library_benchmark_group!(
name = bench_read_bytes;
compare_by_id = true;
benchmarks = perf_bytes
);
library_benchmark_group!(
name = bench_read_struct;
benchmarks = perf_struct
);
main!(
library_benchmark_groups = bench_read_primitives,
bench_read_string,
bench_read_bytes,
bench_read_struct
);