1
0
mirror of https://github.com/golang/go synced 2024-11-14 15:00:27 -07:00
go/src/reflect
Bryan C. Mills f5f5a00b92 reflect: parallelize benchmarks
Add a benchmark for PtrTo: it's the motivation for #17973, which is
the motivation for #18177.

Results remain comparable with the non-parallel version with -cpu=1:

benchmark                             old ns/op     new ns/op     delta
BenchmarkCall                         357           360           +0.84%
BenchmarkCall-6                       90.3          90.7          +0.44%
BenchmarkCallArgCopy/size=128         319           323           +1.25%
BenchmarkCallArgCopy/size=128-6       329           82.2          -75.02%
BenchmarkCallArgCopy/size=256         354           335           -5.37%
BenchmarkCallArgCopy/size=256-6       340           85.2          -74.94%
BenchmarkCallArgCopy/size=1024        374           703           +87.97%
BenchmarkCallArgCopy/size=1024-6      378           95.8          -74.66%
BenchmarkCallArgCopy/size=4096        627           631           +0.64%
BenchmarkCallArgCopy/size=4096-6      643           120           -81.34%
BenchmarkCallArgCopy/size=65536       10502         10169         -3.17%
BenchmarkCallArgCopy/size=65536-6     10298         2240          -78.25%
BenchmarkFieldByName1                 139           132           -5.04%
BenchmarkFieldByName1-6               144           24.9          -82.71%
BenchmarkFieldByName2                 2721          2778          +2.09%
BenchmarkFieldByName2-6               3953          578           -85.38%
BenchmarkFieldByName3                 19136         18357         -4.07%
BenchmarkFieldByName3-6               23072         3850          -83.31%
BenchmarkInterfaceBig                 12.7          15.5          +22.05%
BenchmarkInterfaceBig-6               14.2          2.48          -82.54%
BenchmarkInterfaceSmall               13.1          15.1          +15.27%
BenchmarkInterfaceSmall-6             13.0          2.54          -80.46%
BenchmarkNew                          43.8          43.0          -1.83%
BenchmarkNew-6                        40.5          6.67          -83.53%

benchmark                             old MB/s     new MB/s     speedup
BenchmarkCallArgCopy/size=128         400.24       395.15       0.99x
BenchmarkCallArgCopy/size=128-6       388.74       1557.76      4.01x
BenchmarkCallArgCopy/size=256         722.44       762.44       1.06x
BenchmarkCallArgCopy/size=256-6       751.98       3003.83      3.99x
BenchmarkCallArgCopy/size=1024        2733.22      1455.50      0.53x
BenchmarkCallArgCopy/size=1024-6      2706.40      10687.53     3.95x
BenchmarkCallArgCopy/size=4096        6523.32      6488.25      0.99x
BenchmarkCallArgCopy/size=4096-6      6363.85      34003.09     5.34x
BenchmarkCallArgCopy/size=65536       6239.88      6444.46      1.03x
BenchmarkCallArgCopy/size=65536-6     6363.83      29255.26     4.60x

benchmark           old allocs     new allocs     delta
BenchmarkCall       0              0              +0.00%
BenchmarkCall-6     0              0              +0.00%

benchmark           old bytes     new bytes     delta
BenchmarkCall       0             0             +0.00%
BenchmarkCall-6     0             0             +0.00%

updates #17973
updates #18177

Change-Id: If70c5c742e8d1b138347f4963ad7cff38fffc018
Reviewed-on: https://go-review.googlesource.com/36831
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-26 19:04:30 +00:00
..
all_test.go reflect: parallelize benchmarks 2017-04-26 19:04:30 +00:00
asm_386.s all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
asm_amd64.s all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
asm_amd64p32.s all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
asm_arm64.s all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
asm_arm.s all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
asm_mips64x.s all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
asm_mipsx.s reflect: add support for GOARCH=mips{,le} 2016-11-03 23:01:05 +00:00
asm_ppc64x.s all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
asm_s390x.s reflect: add s390x support 2016-04-06 04:23:06 +00:00
deepequal.go reflect: fix DeepEqual for some cyclic corner cases 2016-10-24 15:20:23 +00:00
example_test.go reflect: add example for StructOf 2016-12-06 20:18:12 +00:00
export_test.go reflect: unexported fields are tied to a package 2016-11-10 14:06:23 +00:00
makefunc.go runtime: clean up and improve reflect.methodValue comments 2016-12-19 21:02:53 +00:00
set_test.go reflect: recognize unnamed directional channels 2016-03-04 20:34:30 +00:00
swapper.go reflect: add Swapper func 2016-09-30 20:26:54 +00:00
tostring_test.go
type.go reflect: document ptrdata field of rtype 2017-04-18 15:30:04 +00:00
value.go reflect: add MakeMapWithSize for creating maps with size hint 2017-04-04 20:01:43 +00:00