From 41f36cafed1c6401a569877effbfd4f9b0168ad3 Mon Sep 17 00:00:00 2001 From: Cai Bear Date: Sun, 5 May 2024 07:04:21 -0700 Subject: [PATCH] Clear buffer before serializing to measure size. --- src/bench_wiring.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bench_wiring.rs b/src/bench_wiring.rs index 42ee808..692dee6 100644 --- a/src/bench_wiring.rs +++ b/src/bench_wiring.rs @@ -1,5 +1,5 @@ use criterion::{black_box, Criterion}; -use wiring::prelude::{BufUnWire, BufWire, Unwiring, Wire, Wiring}; +use wiring::prelude::{BufUnWire, BufWire, Unwiring, Wiring}; pub fn bench(name: &'static str, c: &mut Criterion, data: &T) { const BUFFER_LEN: usize = 10_000_000; @@ -12,7 +12,7 @@ pub fn bench(name: &'static str, c: &mut Crite b.iter(|| black_box(BufWire::new(&mut wire).wire(black_box(data)).unwrap())) }); - wire.sync_wire(data).unwrap(); + BufWire::new(&mut wire).wire(data).unwrap(); let buffer = wire.as_slice();