Add some motivation for forgetting the parser in the binary
@@ -258,6 +258,11 @@ pub fn main() {
let stdio = io::stdout();
let buffer = std::io::BufWriter::with_capacity(1*1024*1024, stdio.lock());
html::write_html(buffer, &mut p).unwrap();
+ // Since the program will now terminate and the memory will be returned
+ // to the operating system anyway, there is no point in tidely cleaning
+ // up all the datastructures we have used. We shouldn't do this if we'd
+ // do other things after this, because this is basically intentionally
+ // leaking data. Skipping cleanup let's us return a bit (~5%) faster.
mem::forget(p);
}
}
