1
0
mirror of https://github.com/golang/go synced 2024-10-04 13:11:22 -06:00
go/src/cmd
Robert Griesemer f542576b9e cmd/compile: add compiler phase timing
Timings is a simple data structure that collects times of labeled
Start/Stop events describing timed phases, which later can be written
to a file.

Adjacent phases with common label prefix are automatically collected
in a group together with the accumulated phase time.

Timing data can be appended to a file in benchmark data format
using the new -bench flag:

$ go build -gcflags="-bench=/dev/stdout" -o /dev/null go/types
commit: devel +8847c6b Mon Aug 15 17:51:53 2016 -0700
goos: darwin
goarch: amd64
BenchmarkCompile:go/types:fe:init              1       663292 ns/op      0.07 %
BenchmarkCompile:go/types:fe:loadsys           1      1337371 ns/op      0.14 %
BenchmarkCompile:go/types:fe:parse             1     47008869 ns/op      4.91 %    10824 lines    230254 lines/s
BenchmarkCompile:go/types:fe:typecheck:top1    1      2843343 ns/op      0.30 %
BenchmarkCompile:go/types:fe:typecheck:top2    1       447457 ns/op      0.05 %
BenchmarkCompile:go/types:fe:typecheck:func    1     15119595 ns/op      1.58 %      427 funcs     28241 funcs/s
BenchmarkCompile:go/types:fe:capturevars       1        56314 ns/op      0.01 %
BenchmarkCompile:go/types:fe:inlining          1      9805767 ns/op      1.02 %
BenchmarkCompile:go/types:fe:escapes           1     53598646 ns/op      5.60 %
BenchmarkCompile:go/types:fe:xclosures         1       199302 ns/op      0.02 %
BenchmarkCompile:go/types:fe:subtotal          1    131079956 ns/op     13.70 %
BenchmarkCompile:go/types:be:compilefuncs      1    692009428 ns/op     72.33 %      427 funcs       617 funcs/s
BenchmarkCompile:go/types:be:externaldcls      1        54591 ns/op      0.01 %
BenchmarkCompile:go/types:be:dumpobj           1    133478173 ns/op     13.95 %
BenchmarkCompile:go/types:be:subtotal          1    825542192 ns/op     86.29 %
BenchmarkCompile:go/types:unaccounted          1       106101 ns/op      0.01 %
BenchmarkCompile:go/types:total                1    956728249 ns/op    100.00 %

For #16169.

Change-Id: I93265fe0cb08e47cd413608d0824c5dd35ba7899
Reviewed-on: https://go-review.googlesource.com/24462
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-08-17 17:27:04 +00:00
..
addr2line
api all: rename vendored golang.org/x/net packages to golang_org 2016-07-13 18:35:40 +00:00
asm cmd/internal/obj: convert Aconv to a stringer 2016-08-16 15:03:07 +00:00
cgo cmd/cgo: error, not panic, if not enough arguments to function 2016-06-21 04:32:04 +00:00
compile cmd/compile: add compiler phase timing 2016-08-17 17:27:04 +00:00
cover cmd: fixed certain vet warnings 2016-05-12 15:58:30 +00:00
dist cmd/dist: make zosarch.go deterministic 2016-06-16 19:32:33 +00:00
doc cmd/doc: ensure functions with unexported return values are shown 2016-08-02 03:24:48 +00:00
fix all: single space after period. 2016-03-02 00:13:47 +00:00
go cmd/go: document -v flag for get 2016-08-16 18:35:34 +00:00
gofmt gofmt: remove unneeded call to os.Exit 2016-07-11 18:37:12 +00:00
internal cmd/internal/obj: reduce per-architecture opcode space 2016-08-16 22:53:48 +00:00
link cmd/link: when dynlinking, do not mangle short symbol names 2016-08-16 00:37:09 +00:00
nm all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
objdump cmd/objdump: skip TestDisasm* on s390x 2016-04-12 18:10:47 +00:00
pack all: use SeekStart, SeekCurrent, SeekEnd 2016-05-06 00:10:41 +00:00
pprof cmd/pprof: don't use local symbolization for remote source 2016-06-25 00:36:40 +00:00
trace cmd/trace: split large traces into parts 2016-05-12 17:53:59 +00:00
vendor cmd/objdump: fix disassembly suffixes 2016-06-23 02:28:18 +00:00
vet cmd/vet: remove copylock warning about result types and calls 2016-07-04 03:23:23 +00:00
yacc cmd/yacc: error rather than panic when TEMPSIZE is too small 2016-06-23 04:29:35 +00:00