Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(621)

Issue 6280049: code review 6280049: cmd/gc: inline convT2E when T is uintptr-shaped. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 10 months ago by nigeltao
Modified:
12 years, 9 months ago
Reviewers:
CC:
rsc, dave_cheney.net, bsiegert, dsymonds, golang-dev
Visibility:
Public.

Description

cmd/gc: inline convT2E when T is uintptr-shaped. GOARCH=amd64 benchmarks src/pkg/runtime benchmark old ns/op new ns/op delta BenchmarkConvT2ESmall 10 10 +1.00% BenchmarkConvT2EUintptr 9 0 -92.07% BenchmarkConvT2EBig 74 74 -0.27% BenchmarkConvT2I 27 26 -3.62% BenchmarkConvI2E 4 4 -7.05% BenchmarkConvI2I 20 19 -2.99% test/bench/go1 benchmark old ns/op new ns/op delta BenchmarkBinaryTree17 5930908000 5937260000 +0.11% BenchmarkFannkuch11 3927057000 3933556000 +0.17% BenchmarkGobDecode 21998090 21870620 -0.58% BenchmarkGobEncode 12725310 12734480 +0.07% BenchmarkGzip 567617600 567892800 +0.05% BenchmarkGunzip 178284100 178706900 +0.24% BenchmarkJSONEncode 87693550 86794300 -1.03% BenchmarkJSONDecode 314212600 324115000 +3.15% BenchmarkMandelbrot200 7016640 7073766 +0.81% BenchmarkParse 7852100 7892085 +0.51% BenchmarkRevcomp 1285663000 1286147000 +0.04% BenchmarkTemplate 566823800 567606200 +0.14% I'm not entirely sure why the JSON* numbers have changed, but eyeballing the profile suggests that it could be spending less and more time in runtime.{new,old}stack, so it could simply be stack-split boundary noise.

Patch Set 1 #

Patch Set 2 : diff -r bff65816ad27 https://code.google.com/p/go/ #

Patch Set 3 : diff -r 58e4358fda51 https://code.google.com/p/go/ #

Patch Set 4 : diff -r 58e4358fda51 https://code.google.com/p/go/ #

Patch Set 5 : diff -r 7021c8a8a25a https://code.google.com/p/go/ #

Patch Set 6 : diff -r 7021c8a8a25a https://code.google.com/p/go/ #

Patch Set 7 : diff -r 7021c8a8a25a https://code.google.com/p/go/ #

Total comments: 1

Patch Set 8 : diff -r 7ba52afb6a1b https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+201 lines, -7 lines) Patch
M src/cmd/5g/cgen.c View 1 2 3 4 5 6 2 chunks +14 lines, -0 lines 0 comments Download
M src/cmd/6g/cgen.c View 1 2 3 4 2 chunks +14 lines, -0 lines 0 comments Download
M src/cmd/8g/cgen.c View 1 2 3 4 5 6 2 chunks +14 lines, -0 lines 0 comments Download
M src/cmd/gc/gen.c View 1 2 3 4 2 chunks +16 lines, -3 lines 0 comments Download
M src/cmd/gc/go.h View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M src/cmd/gc/walk.c View 1 2 3 4 2 chunks +18 lines, -1 line 0 comments Download
M src/pkg/runtime/iface_test.go View 1 2 3 4 1 chunk +9 lines, -3 lines 0 comments Download
A test/convT2E.go View 1 2 3 4 5 6 7 1 chunk +114 lines, -0 lines 0 comments Download

Messages

Total messages: 16
nigeltao
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
12 years, 9 months ago (2012-06-12 05:26:44 UTC) #1
dave_cheney.net
This is great Nigel! I'm surprised that it made so little difference in the go1 ...
12 years, 9 months ago (2012-06-12 07:00:40 UTC) #2
dave_cheney.net
linux/arm benchmark old ns/op new ns/op delta BenchmarkBinaryTree17 36973266000 36960083000 -0.04% BenchmarkFannkuch11 34931763000 35084259000 +0.44% ...
12 years, 9 months ago (2012-06-12 07:45:34 UTC) #3
nigeltao
2012/6/12 <dave@cheney.net>: > Weird. Trips through itab genrally account for at minimum 3% of a ...
12 years, 9 months ago (2012-06-12 08:13:20 UTC) #4
dave_cheney.net
Here is a random data point (produced with the printf hammer) deadwood(~/go/test/bench/go1) % sort b.txt ...
12 years, 9 months ago (2012-06-12 11:05:56 UTC) #5
bsiegert
On Tue, Jun 12, 2012 at 7:26 AM, <nigeltao@golang.org> wrote: > BenchmarkConvT2EUintptr 9 0 -92.07% ...
12 years, 9 months ago (2012-06-12 12:13:11 UTC) #6
dsymonds
On Tue, Jun 12, 2012 at 10:13 PM, Benny Siegert <bsiegert@gmail.com> wrote: > On Tue, ...
12 years, 9 months ago (2012-06-12 12:15:47 UTC) #7
rsc
The JSON numbers change any time you look at them funny.
12 years, 9 months ago (2012-06-12 13:24:51 UTC) #8
nigeltao
On 12 June 2012 22:13, Benny Siegert <bsiegert@gmail.com> wrote: > On Tue, Jun 12, 2012 ...
12 years, 9 months ago (2012-06-12 23:50:55 UTC) #9
nigeltao
On 12 June 2012 21:05, Dave Cheney <dave@cheney.net> wrote: > Here is a random data ...
12 years, 9 months ago (2012-06-12 23:53:10 UTC) #10
dave_cheney.net
Clean tree. I'll rebuild with your patch and post the results. On Wed, Jun 13, ...
12 years, 9 months ago (2012-06-12 23:55:48 UTC) #11
nigeltao
On 12 June 2012 22:15, David Symonds <dsymonds@golang.org> wrote: > It's inlined, and the resolution ...
12 years, 9 months ago (2012-06-13 00:01:09 UTC) #12
dave_cheney.net
deadwood(~/go/test/bench/go1) % sort b2.txt | uniq -c | sort -nr 5506080 convT2I 4627295 assertE2T 1585844 ...
12 years, 9 months ago (2012-06-13 00:05:20 UTC) #13
rsc
http://codereview.appspot.com/6280049/diff/11007/test/convT2E.go File test/convT2E.go (right): http://codereview.appspot.com/6280049/diff/11007/test/convT2E.go#newcode7 test/convT2E.go:7: // Test conversion from non-interface types to the empty ...
12 years, 9 months ago (2012-06-13 15:57:42 UTC) #14
rsc
LGTM Please update the test.
12 years, 9 months ago (2012-06-13 16:00:41 UTC) #15
nigeltao
12 years, 9 months ago (2012-06-14 00:53:37 UTC) #16
*** Submitted as http://code.google.com/p/go/source/detail?r=8c461c433cb5 ***

cmd/gc: inline convT2E when T is uintptr-shaped.

GOARCH=amd64 benchmarks

src/pkg/runtime
benchmark                  old ns/op    new ns/op    delta
BenchmarkConvT2ESmall             10           10   +1.00%
BenchmarkConvT2EUintptr            9            0  -92.07%
BenchmarkConvT2EBig               74           74   -0.27%
BenchmarkConvT2I                  27           26   -3.62%
BenchmarkConvI2E                   4            4   -7.05%
BenchmarkConvI2I                  20           19   -2.99%

test/bench/go1
benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17    5930908000   5937260000   +0.11%
BenchmarkFannkuch11      3927057000   3933556000   +0.17%
BenchmarkGobDecode         21998090     21870620   -0.58%
BenchmarkGobEncode         12725310     12734480   +0.07%
BenchmarkGzip             567617600    567892800   +0.05%
BenchmarkGunzip           178284100    178706900   +0.24%
BenchmarkJSONEncode        87693550     86794300   -1.03%
BenchmarkJSONDecode       314212600    324115000   +3.15%
BenchmarkMandelbrot200      7016640      7073766   +0.81%
BenchmarkParse              7852100      7892085   +0.51%
BenchmarkRevcomp         1285663000   1286147000   +0.04%
BenchmarkTemplate         566823800    567606200   +0.14%

I'm not entirely sure why the JSON* numbers have changed, but
eyeballing the profile suggests that it could be spending less
and more time in runtime.{new,old}stack, so it could simply be
stack-split boundary noise.

R=rsc, dave, bsiegert, dsymonds
CC=golang-dev
http://codereview.appspot.com/6280049
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b