]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/gc: remove redundant Nod(OXXX, ...) pattern
authorDave Cheney <dave@cheney.net>
Wed, 23 Mar 2016 02:27:49 +0000 (13:27 +1100)
committerDave Cheney <dave@cheney.net>
Wed, 23 Mar 2016 10:59:55 +0000 (10:59 +0000)
commita4be24cbe6b10ee66674834d571c196622ff55ed
tree50f6199b6cd6c9076bf014e91845074e4f9f6821
parent1374515a1cf2279c2e47a4ee03a3616781814ad0
cmd/compile/internal/gc: remove redundant Nod(OXXX, ...) pattern

The pattern

    n := Nod(OXXX, nil, nil)
    Nodconst(n, ...)

was a leftover from the C days where n must be heap allocated.

No change in benchmarks, none expected as n escapes anyway.

name      old time/op    new time/op    delta
Template     391ms ± 6%     388ms ± 5%    ~     (p=0.659 n=20+20)
GoTypes      1.27s ± 1%     1.27s ± 2%    ~     (p=0.828 n=18+20)
Compiler     6.16s ± 2%     6.15s ± 1%    ~     (p=0.947 n=20+20)

name      old alloc/op   new alloc/op   delta
Template    63.7MB ± 0%    63.7MB ± 0%    ~     (p=0.414 n=20+20)
GoTypes      219MB ± 0%     219MB ± 0%    ~     (p=0.904 n=20+20)
Compiler     980MB ± 0%     980MB ± 0%  +0.00%  (p=0.007 n=20+19)

name      old allocs/op  new allocs/op  delta
Template      586k ± 0%      586k ± 0%    ~     (p=0.564 n=19+20)
GoTypes      1.80M ± 0%     1.80M ± 0%    ~     (p=0.718 n=20+20)
Compiler     7.74M ± 0%     7.74M ± 0%    ~     (p=0.358 n=20+20)

The reuse of nc in multiple overlapping scopes in walk.go is the worst.

Change-Id: I4ed6a63f7ffbfff68124ad609f6e3a68d95cbbba
Reviewed-on: https://go-review.googlesource.com/21015
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/typecheck.go
src/cmd/compile/internal/gc/walk.go