Descriptiongo/printer, gofmt: 20 to 30% faster gofmt
Buffer intermediate output via a bytes.Buffer and thus avoid
calling through the entire Writer stack for every item printed.
There is more opportunity for improvements along the same lines.
Before (best of 3 runs):
- printer.BenchmarkPrint 50 47959760 ns/op
- time gofmt -l $GOROOT/src real 0m11.517s
After (best of 3 runs):
- printer.BenchmarkPrint 50 32056640 ns/op (= -33%)
- time gofmt -l $GOROOT/src real 0m9.070s (= -21%)
Patch Set 1 #Patch Set 2 : diff -r b646abe0a2ee https://go.googlecode.com/hg/ #Patch Set 3 : diff -r b646abe0a2ee https://go.googlecode.com/hg/ #Patch Set 4 : diff -r b646abe0a2ee https://go.googlecode.com/hg/ #Patch Set 5 : diff -r b646abe0a2ee https://go.googlecode.com/hg/ #
MessagesTotal messages: 3
|