]> Cypherpunks repositories - gostls13.git/commit
go/printer: measure lines/construct in generated output rather than incoming source
authorRobert Griesemer <gri@golang.org>
Thu, 27 Feb 2014 19:35:53 +0000 (11:35 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 27 Feb 2014 19:35:53 +0000 (11:35 -0800)
commit28cc8aa89eb1830c71c8cf5c39f7ce4a0ceb4899
tree325e2cc048996bcc7e169cf3c69f9db9bdcd570c
parentb00e4770d962289ef1a542f153408d55e3307167
go/printer: measure lines/construct in generated output rather than incoming source

No change to $GOROOT/src, misc formatting.

Nice side-effect: almost 3% faster runs because it's much faster to compute
line number differences in the generated output than the incoming source.

Benchmark run, best of 5 runs, before and after:
BenchmarkPrint      200   12347587 ns/op
BenchmarkPrint      200   11999061 ns/op

Fixes #4504.

LGTM=adonovan
R=golang-codereviews, adonovan
CC=golang-codereviews
https://golang.org/cl/69260045
src/pkg/go/printer/nodes.go
src/pkg/go/printer/printer.go
src/pkg/go/printer/testdata/comments2.golden
src/pkg/go/printer/testdata/comments2.input
src/pkg/go/printer/testdata/declarations.golden
src/pkg/go/printer/testdata/declarations.input