Skip to content

Commit 632f87d

Browse files
authored
Unbox writer (3-5% faster) (#33)
Unbox writer
1 parent c7c1f66 commit 632f87d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tpchgen-cli/src/main.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,10 @@ fn main() -> io::Result<()> {
102102
Ok(())
103103
}
104104

105-
fn new_table_writer(cli: &Cli, filename: &str) -> io::Result<Box<dyn Write>> {
105+
fn new_table_writer(cli: &Cli, filename: &str) -> io::Result<BufWriter<File>> {
106106
let path = cli.output_dir.join(filename);
107107
let file = File::create(path)?;
108-
let writer = BufWriter::with_capacity(32 * 1024, file);
109-
110-
Ok(Box::new(writer))
108+
Ok(BufWriter::with_capacity(32 * 1024, file))
111109
}
112110

113111
fn generate_nation(cli: &Cli) -> io::Result<()> {

0 commit comments

Comments
 (0)