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)?;