From 86b95fb53ae9b31c62a946e8c1d7e9d35c4c0fba Mon Sep 17 00:00:00 2001 From: Christian Reitter Date: Sun, 15 Dec 2024 14:25:15 +0100 Subject: [PATCH] Note potential functionality feature --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index 5a744d2..0c39489 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,6 +35,7 @@ fn main() -> Result<(), Box> { let mut bloom = Bloom::new_for_fp_rate(opts.num_items, opts.fp_rate); let file = File::open(&opts.input_file)?; + // buffer capacity in bytes, up from default 8K bytes // this only results in a very minor speedup, if any BufReader::with_capacity(1_000_000, file) @@ -42,6 +43,11 @@ fn main() -> Result<(), Box> { .map(|l| l.unwrap()) .for_each(|line| bloom.set(&line)); + // potential feature: print status update every n lines within the loop + // if count & 0b1_1111_1111_1111_1111_1111 == 0 { + // println!("Read {} lines", count); + // } + // prepare output file let path = PathBuf::from(opts.output_file); let mut outfile = File::create(path)?;