]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: slightly regularize interface method types
authorMatthew Dempsky <mdempsky@google.com>
Tue, 25 Oct 2016 23:25:57 +0000 (16:25 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 25 Oct 2016 23:54:41 +0000 (23:54 +0000)
commitd89b70d43357e7f016331356014253647af02971
tree22b41cca0c81be8155eda43483ff713ecd995e96
parentc78d072c8e4a8b0283da21423732f93c503711a4
cmd/compile: slightly regularize interface method types

Use a single *struct{} type instance rather than reconstructing one
for every declared/imported interface method. Minor allocations win:

name       old alloc/op    new alloc/op    delta
Template      41.8MB ± 0%     41.7MB ± 0%  -0.10%         (p=0.000 n=9+10)
Unicode       34.2MB ± 0%     34.2MB ± 0%    ~           (p=0.971 n=10+10)
GoTypes        123MB ± 0%      122MB ± 0%  -0.03%         (p=0.000 n=9+10)
Compiler       495MB ± 0%      495MB ± 0%  -0.01%        (p=0.000 n=10+10)

name       old allocs/op   new allocs/op   delta
Template        409k ± 0%       408k ± 0%  -0.13%        (p=0.000 n=10+10)
Unicode         354k ± 0%       354k ± 0%    ~           (p=0.516 n=10+10)
GoTypes        1.22M ± 0%      1.22M ± 0%  -0.03%        (p=0.009 n=10+10)
Compiler       4.43M ± 0%      4.43M ± 0%  -0.02%        (p=0.000 n=10+10)

Change-Id: Id3a4ca3dd09112bb96ccc982b06c9e79f661d31f
Reviewed-on: https://go-review.googlesource.com/32051
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/dcl.go
src/cmd/compile/internal/gc/universe.go