diff --git a/benches/ptfkit-rs/src/main.rs b/benches/ptfkit-rs/src/main.rs index e1ab19f..2ed57cf 100644 --- a/benches/ptfkit-rs/src/main.rs +++ b/benches/ptfkit-rs/src/main.rs @@ -1,6 +1,7 @@ use std::error::Error; use std::fs::File; use std::hint::black_box; +use std::io::BufReader; use std::path::Path; use std::time::Instant; @@ -24,7 +25,8 @@ fn parse_arguments() -> Result> { fn load_array(dataset: &Path, name: &str) -> Result, Box> { let file = File::open(dataset.join(format!("{name}.npy")))?; - Ok(npyz::NpyFile::new(file)?.into_vec::()?) + let reader = BufReader::new(file); + Ok(npyz::NpyFile::new(reader)?.into_vec::()?) } fn print_record(case: &str, samples: usize, elapsed_ns: u128) {