Note potential functionality feature

This commit is contained in:
Christian Reitter 2024-12-15 14:25:15 +01:00
parent e0d047d712
commit 86b95fb53a
1 changed files with 6 additions and 0 deletions

View File

@ -35,6 +35,7 @@ fn main() -> Result<(), Box<dyn Error>> {
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<dyn Error>> {
.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)?;