/bufp

bufp provides faster way to print to stdout.

Primary LanguageGoMIT LicenseMIT

bufp

Go Report Card Build Status

Package bufp provides a faster way to print values to io.Writer.
(about 5.x ~ 9.x faster compared to fmt.Printf)
This package is inspired by Using Go for competitive programming.

bw := bufp.NewStdBWriter()
// stdout must be flushed manually.
defer bw.W.Flush()
bw.Brintf("%v %v %v\n", 123, "gop", 99.999)

or

bw := bufp.NewWriter(bufio.NewWriter(os.Stdout))
// stdout must be flushed manually.
defer bw.Flush()
bufp.Printf(bw, "%v %v %v\n", 123, "gop", 99.999)