Skip to content

Commit

Permalink
Optimize: buffer stdout for 2-3x speedup
Browse files Browse the repository at this point in the history
  • Loading branch information
felixge committed Jan 11, 2015
1 parent 842cfa1 commit 69b5fe0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xxd.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ func main() {
panic(err)
}
defer f.Close()
if err := XXD(f, os.Stdout); err != nil {
out := bufio.NewWriter(os.Stdout)
defer out.Flush()
if err := XXD(f, out); err != nil {
panic(err)
}
}
Expand Down

0 comments on commit 69b5fe0

Please sign in to comment.