]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: preallocate storage for three Value args
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 7 Mar 2016 05:22:11 +0000 (21:22 -0800)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 8 Mar 2016 18:46:49 +0000 (18:46 +0000)
benchstat master2 arg3b
name      old time/op    new time/op    delta
Template     441ms ± 4%     444ms ± 6%    ~     (p=0.335 n=22+25)
GoTypes      1.51s ± 2%     1.51s ± 2%    ~     (p=0.129 n=25+21)
Compiler     5.59s ± 1%     5.56s ± 2%  -0.65%  (p=0.001 n=24+21)

name      old alloc/op   new alloc/op   delta
Template    85.6MB ± 0%    85.3MB ± 0%  -0.40%  (p=0.000 n=25+24)
GoTypes      307MB ± 0%     305MB ± 0%  -0.38%  (p=0.000 n=25+25)
Compiler    1.06GB ± 0%    1.05GB ± 0%  -0.43%  (p=0.000 n=25+25)

name      old allocs/op  new allocs/op  delta
Template     1.10M ± 0%     1.09M ± 0%  -1.04%  (p=0.000 n=25+25)
GoTypes      3.36M ± 0%     3.32M ± 0%  -1.13%  (p=0.000 n=25+24)
Compiler     13.0M ± 0%     12.9M ± 0%  -1.12%  (p=0.000 n=25+25)

Change-Id: I1280b846e895c00b95bb6664958a7765bd819610
Reviewed-on: https://go-review.googlesource.com/20296
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/TODO
src/cmd/compile/internal/ssa/sizeof_test.go
src/cmd/compile/internal/ssa/value.go

index c5d6884e278bbeb32ce241697bb7abb8502625f6..84e18039c7ccc737e4d7fe29e0b5537d82a02cd0 100644 (file)
@@ -29,7 +29,6 @@ Optimizations (better compiled code)
 
 Optimizations (better compiler)
 -------------------------------
-- OpStore uses 3 args.  Increase the size of Value.argstorage to 3?
 - Handle signed division overflow and sign extension earlier
 
 Regalloc
index 2232913f5ddf8b7b7eabd0933c36c0fbb7ab660b..8b79ecfe687834d85045cf88f3afb46a4a16ee52 100644 (file)
@@ -22,7 +22,7 @@ func TestSizeof(t *testing.T) {
                _32bit uintptr     // size on 32bit platforms
                _64bit uintptr     // size on 64bit platforms
        }{
-               {Value{}, 60, 104},
+               {Value{}, 64, 112},
                {Block{}, 124, 232},
        }
 
index 3ec788355d995f0eb9609217c855d07210d80239..a245d26f98d1075bbbf68aa89eb1b67b657698e2 100644 (file)
@@ -38,8 +38,8 @@ type Value struct {
        // Source line number
        Line int32
 
-       // Storage for the first two args
-       argstorage [2]*Value
+       // Storage for the first three args
+       argstorage [3]*Value
 }
 
 // Examples: