• Josh Bleecher Snyder's avatar
    cmd/compile: don’t generate Nodes for PCDATA · 080e2d43
    Josh Bleecher Snyder authored
    We were allocating two Nodes just to help Naddr
    fill in Type and Offset.
    Fill them in directly instead.
    
    Passes toolstash -cmp.
    
    name       old time/op     new time/op     delta
    Template       324ms ± 5%      320ms ± 5%  -1.34%        (p=0.033 n=25+22)
    Unicode        164ms ± 6%      162ms ± 5%    ~           (p=0.152 n=24+23)
    GoTypes        1.05s ± 5%      1.05s ± 6%    ~           (p=0.653 n=23+25)
    Compiler       5.12s ± 4%      5.06s ± 3%  -1.13%        (p=0.006 n=25+23)
    MakeBash       41.8s ± 2%      41.6s ± 3%  -0.65%        (p=0.024 n=24+24)
    
    name       old alloc/op    new alloc/op    delta
    Template      57.8MB ± 0%     57.3MB ± 0%  -0.87%        (p=0.000 n=25+25)
    Unicode       41.2MB ± 0%     41.1MB ± 0%  -0.29%        (p=0.000 n=24+22)
    GoTypes        193MB ± 0%      191MB ± 0%  -0.97%        (p=0.000 n=22+25)
    Compiler       850MB ± 0%      840MB ± 0%  -1.28%        (p=0.000 n=25+25)
    
    name       old allocs/op   new allocs/op   delta
    Template        506k ± 0%       500k ± 0%  -1.15%        (p=0.000 n=25+25)
    Unicode         402k ± 0%       400k ± 0%  -0.37%        (p=0.000 n=24+25)
    GoTypes        1.52M ± 0%      1.50M ± 0%  -1.42%        (p=0.000 n=25+25)
    Compiler       6.16M ± 0%      6.04M ± 0%  -2.05%        (p=0.000 n=24+25)
    
    Change-Id: Ia80d28b32023a620d9ddf99c1252c16fa6477b3c
    Reviewed-on: https://go-review.googlesource.com/21174
    Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
    080e2d43
plive.go 48.5 KB