1
0
mirror of https://github.com/golang/go synced 2024-10-03 04:21:22 -06:00
go/src/cmd
Josh Bleecher Snyder 25e793d7ea cmd/internal/gc, runtime: speed up some cases of _, ok := i.(T)
Some type assertions of the form _, ok := i.(T) allow efficient inlining.
Such type assertions commonly show up in type switches.
For example, with this optimization, using 6g, the length of
encoding/binary's intDataSize function shrinks from 2224 to 1728 bytes (-22%).

benchmark                    old ns/op     new ns/op     delta
BenchmarkAssertI2E2Blank     4.67          0.82          -82.44%
BenchmarkAssertE2T2Blank     4.38          0.83          -81.05%
BenchmarkAssertE2E2Blank     3.88          0.83          -78.61%
BenchmarkAssertE2E2          14.2          14.4          +1.41%
BenchmarkAssertE2T2          10.3          10.4          +0.97%
BenchmarkAssertI2E2          13.4          13.3          -0.75%

Change-Id: Ie9798c3e85432bb8e0f2c723afc376e233639df7
Reviewed-on: https://go-review.googlesource.com/7697
Reviewed-by: Keith Randall <khr@golang.org>
2015-03-19 16:20:32 +00:00
..
5g cmd/...: remove use of func() { ... }() in loop increment 2015-03-17 00:34:00 +00:00
5l cmd/5l: make 5l work on openbsd 2015-03-13 02:51:12 +00:00
6g cmd/6g: make proginfo register bits constants 2015-03-17 01:24:40 +00:00
6l cmd/5l etc: restore comments lost during C -> Go conversion 2015-03-05 21:49:39 +00:00
7g cmd/7g: add ARM64 Go compiler, based on 9g 2015-03-16 18:45:26 +00:00
7l cmd/7l: add the ARM64 linker 2015-03-16 18:45:16 +00:00
8g cmd/internal/gc, etc: remove canemitecode of Naddr 2015-03-13 22:56:42 +00:00
8l all: remove dragonfly/386 port 2015-03-14 10:47:19 +00:00
9g cmd/internal/gc, etc: remove canemitecode of Naddr 2015-03-13 22:56:42 +00:00
9l cmd/...: remove use of func() { ... }() in loop increment 2015-03-17 00:34:00 +00:00
addr2line cmd/addr2line: exclude Go tool test on darwin/arm 2015-02-26 23:06:30 +00:00
api Revert "cmd/api: treat a hex-y VERSION as devel and permit API changes" 2015-02-08 20:44:22 +00:00
asm cmd/asm: add support for ARM64 2015-03-16 18:45:08 +00:00
cgo all: use "reports whether" in place of "returns true if(f)" 2015-03-18 15:14:06 +00:00
dist cmd/dist: show reason for command failure 2015-03-17 00:30:50 +00:00
fix all: use "reports whether" in place of "returns true if(f)" 2015-03-18 15:14:06 +00:00
go all: use "reports whether" in place of "returns true if(f)" 2015-03-18 15:14:06 +00:00
gofmt all: use "reports whether" in place of "returns true if(f)" 2015-03-18 15:14:06 +00:00
internal cmd/internal/gc, runtime: speed up some cases of _, ok := i.(T) 2015-03-19 16:20:32 +00:00
link debug/goobj: move to cmd/internal/goobj 2014-11-16 20:52:45 -05:00
nm cmd/nm: exclude Go tool test on darwin/arm 2015-02-26 23:07:27 +00:00
objdump cmd/objdump: disable TestDisasm.* on arm64 2015-03-16 18:46:52 +00:00
old5a all: mv 5a old5a and so on 2015-03-02 00:14:11 +00:00
old6a cmd/internal/obj/x86: accept TYPE_MEM in CMPPS 3rd argument 2015-03-05 04:59:35 +00:00
old8a cmd/8g, cmd/old8a: stop renaming x86 import to i386 2015-03-05 06:06:54 +00:00
old9a all: mv 5a old5a and so on 2015-03-02 00:14:11 +00:00
pack cmd/pack: skip fork test on darwin/arm 2015-03-01 01:27:06 +00:00
pprof cmd/pprof/internal/profile: insert blank line after non-doc comment 2015-03-16 23:07:15 +00:00
trace cmd/trace: move goroutine analysis code to internal/trace 2015-03-11 12:53:24 +00:00
yacc cmd/yacc: fix path in documentation 2015-03-17 04:53:21 +00:00