Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(728)

Issue 5432054: code review 5432054: go/printer, gofmt: 20 to 30% faster gofmt (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 3 months ago by gri
Modified:
13 years, 3 months ago
Reviewers:
CC:
r, golang-dev
Visibility:
Public.

Description

go/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/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -80 lines) Patch
M src/pkg/go/printer/nodes.go View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/go/printer/printer.go View 1 13 chunks +57 lines, -79 lines 0 comments Download

Messages

Total messages: 3
gri
Hello r@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 3 months ago (2011-11-22 22:52:29 UTC) #1
r
LGTM
13 years, 3 months ago (2011-11-22 23:04:04 UTC) #2
gri
13 years, 3 months ago (2011-11-22 23:12:37 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=523db6d4d0ae ***

go/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%)

R=r
CC=golang-dev
http://codereview.appspot.com/5432054
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b