1
0
mirror of https://github.com/golang/go synced 2024-10-02 12:18:33 -06:00
go/src/cmd
Martin Möhrmann 8a6e51aede cmd/compile: generate makechan calls with int arguments
Where possible generate calls to runtime makechan with int arguments
during compile time instead of makechan with int64 arguments.

This eliminates converting arguments for calls to makechan with
int64 arguments for platforms where int64 values do not fit into
arguments of type int.

A similar optimization for makeslice was introduced in CL
golang.org/cl/27851.

386:
name                old time/op  new time/op  delta
MakeChan/Byte       52.4ns ± 6%  45.0ns ± 1%  -14.14%  (p=0.000 n=10+10)
MakeChan/Int        54.5ns ± 1%  49.1ns ± 1%   -9.87%  (p=0.000 n=10+10)
MakeChan/Ptr         150ns ± 1%   143ns ± 0%   -4.38%  (p=0.000 n=9+7)
MakeChan/Struct/0   49.2ns ± 2%  43.2ns ± 2%  -12.27%  (p=0.000 n=10+10)
MakeChan/Struct/32  81.7ns ± 2%  76.2ns ± 1%   -6.71%  (p=0.000 n=10+10)
MakeChan/Struct/40  88.4ns ± 2%  82.5ns ± 2%   -6.60%  (p=0.000 n=10+10)

AMD64:
name                old time/op  new time/op  delta
MakeChan/Byte       83.4ns ± 8%  80.8ns ± 3%    ~     (p=0.171 n=10+10)
MakeChan/Int         101ns ± 3%   101ns ± 2%    ~     (p=0.412 n=10+10)
MakeChan/Ptr         128ns ± 1%   128ns ± 1%    ~     (p=0.191 n=10+10)
MakeChan/Struct/0   67.6ns ± 3%  68.7ns ± 4%    ~     (p=0.224 n=10+10)
MakeChan/Struct/32   138ns ± 1%   139ns ± 1%    ~     (p=0.185 n=10+9)
MakeChan/Struct/40   154ns ± 1%   154ns ± 1%  -0.55%  (p=0.027 n=10+9)

Change-Id: Ie854cb066007232c5e9f71ea7d6fe27e81a9c050
Reviewed-on: https://go-review.googlesource.com/55140
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-08-15 05:54:24 +00:00
..
addr2line cmd/go: build test binaries with -s in addition to -w 2017-03-29 17:18:16 +00:00
api api: promote next to go1.9 2017-06-14 21:07:10 +00:00
asm cmd/internal/obj/arm: check illegal base registers in ARM instructions 2017-06-30 19:09:44 +00:00
cgo cmd/cgo: use first error position instead of last one 2017-08-14 05:29:11 +00:00
compile cmd/compile: generate makechan calls with int arguments 2017-08-15 05:54:24 +00:00
cover cmd/cover: take default value of total only once. 2017-06-02 17:59:12 +00:00
dist cmd/dist: add doc file to fix go doc dist 2017-08-11 18:00:53 +00:00
doc cmd/doc: print Go syntax when printing struct.field docs 2017-07-06 21:57:52 +00:00
fix cmd/fix,cmd/gofmt: flush to disk before diffing 2017-03-30 18:19:57 +00:00
go cmd/go: correctly quote environment variables in -x output 2017-08-15 00:13:56 +00:00
gofmt cmd/fix,cmd/gofmt: flush to disk before diffing 2017-03-30 18:19:57 +00:00
internal cmd/link,compile: Provide size for func types 2017-08-14 23:53:27 +00:00
link cmd/link: implement R_X86_64_PC64 relocations 2017-08-15 04:20:44 +00:00
nm all: fix some printf format strings 2017-02-14 02:09:30 +00:00
objdump cmd/internal/objabi: fix the bug of shrinking SymType down to a uint8 2017-05-16 12:26:10 +00:00
pack all: use testing.GoToolPath instead of "go" 2016-08-30 22:49:11 +00:00
pprof cmd/pprof: restore printing descriptive errors from net/http/pprof endpoints 2017-06-15 02:14:24 +00:00
trace cmd/trace: don't shift trace slices to 0 2017-08-11 17:53:17 +00:00
vendor Revert "cmd/vendor/github.com/google/pprof: refresh from upstream" 2017-06-20 19:46:11 +00:00
vet cmd/vet: fix a couple of minor word choices in README 2017-08-14 04:15:59 +00:00