1
0
mirror of https://github.com/golang/go synced 2024-10-02 10:28:34 -06:00
go/src
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
..
archive archive/tar: re-implement USTAR path splitting 2017-08-15 05:40:22 +00:00
bufio Revert "bufio: make Reader.Peek invalidate Unreads" 2017-07-06 03:06:44 +00:00
builtin builtin: use type aliases for rune and byte 2017-06-07 00:42:59 +00:00
bytes bytes: speed up Fields and FieldsFunc 2017-08-14 21:08:51 +00:00
cmd cmd/compile: generate makechan calls with int arguments 2017-08-15 05:54:24 +00:00
compress compress/lzw: don't follow code == hi if last is invalid. 2017-06-08 01:27:37 +00:00
container container/heap: avoid up() invoke if down() success at heap.Remove() 2017-05-13 19:10:24 +00:00
context
crypto crypto/tls: split clientHandshake into multiple methods 2017-08-09 22:24:19 +00:00
database/sql database/sql: fail on unsupported options when context is un-cancellable 2017-08-09 20:06:20 +00:00
debug debug/macho: make Type implements fmt.(Go)Stringer interfaces 2017-08-15 00:13:36 +00:00
encoding encoding/base32: improve performance in common case 2017-08-14 18:51:14 +00:00
errors
expvar expvar: reduce sync.Map overhead for (*Map).Set 2017-05-02 17:13:40 +00:00
flag flag: make default Usage prefer CommandLine's output over just os.Stderr 2017-08-08 01:47:47 +00:00
fmt fmt: add ascii fast path for decoding verbs 2017-08-14 12:25:45 +00:00
go go/types: remove nil check around range 2017-08-10 12:17:11 +00:00
hash all: gofmt 2017-06-21 03:14:30 +00:00
html html: updated entity spec link 2017-08-08 04:29:35 +00:00
image image/gif: fix writeImageBlock with SubImages 2017-06-16 05:45:48 +00:00
index/suffixarray
internal runtime, internal/cpu: CPU capabilities detection for ppc64x 2017-08-14 12:16:42 +00:00
io io/ioutil: add example for ReadFile 2017-07-15 23:28:44 +00:00
log log: adds a Logger Output method Example 2017-07-16 03:57:11 +00:00
math math/big: improve performance for AddMulVVW and mulAddVWW for ppc64x 2017-08-11 13:59:52 +00:00
mime mime/multipart: parse boundary with spaces properly 2017-05-23 22:56:44 +00:00
net net/http: various small cleanups 2017-08-14 16:37:27 +00:00
os os: remove duplicate check from windows os.Stat 2017-07-20 07:43:15 +00:00
path path/filepath: fix TestGlobError 2017-06-15 21:53:23 +00:00
plugin plugin: mention that there are known bugs with plugins 2017-07-28 00:29:08 +00:00
reflect cmd/compile: generate makechan calls with int arguments 2017-08-15 05:54:24 +00:00
regexp regexp: example for MatchString function 2017-07-15 21:13:35 +00:00
runtime cmd/compile: generate makechan calls with int arguments 2017-08-15 05:54:24 +00:00
sort sort: add example for Strings 2017-07-15 23:17:23 +00:00
strconv strconv: cleanup variable declarations in ParseUint 2017-08-15 04:24:52 +00:00
strings strings: use slice instead of list and array in Fields comment 2017-08-14 21:25:53 +00:00
sync sync: delete a sentence from the Map docs 2017-07-21 22:00:47 +00:00
syscall syscall: add missing int flag argument to utimensat 2017-08-15 00:48:48 +00:00
testing testing: explain how SkipNow and FailNow stop execution 2017-08-09 11:47:38 +00:00
text text/template: support indexing into *int* maps 2017-08-12 00:21:16 +00:00
time time: remove unused parameter 2017-08-14 02:22:20 +00:00
unicode unicode: move scripts from FoldCategories to FoldScripts 2017-06-15 01:05:31 +00:00
unsafe
vendor/golang_org/x vendor: update vendored lif 2017-05-29 21:54:12 +00:00
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash
make.bash
make.bat
Make.dist
make.rc
naclmake.bash
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc