• Brad Fitzpatrick's avatar
    cmd/compile: remove most of the Lookupf users and garbage · 060a6915
    Brad Fitzpatrick authored
    Introduce garbage-free LookupN to replace most users of Lookupf.
    
    Also, remove the string interning from LookupBytes which was hurting
    more than helping.
    
    name       old alloc/op    new alloc/op    delta
    Template      63.0MB ± 0%     62.7MB ± 0%  -0.48%         (p=0.000 n=10+9)
    Unicode       43.0MB ± 0%     43.0MB ± 0%  -0.17%         (p=0.000 n=10+7)
    GoTypes        219MB ± 0%      218MB ± 0%  -0.14%        (p=0.000 n=10+10)
    Compiler       992MB ± 0%      991MB ± 0%  -0.12%        (p=0.000 n=10+10)
    
    name       old allocs/op   new allocs/op   delta
    Template        683k ± 0%       681k ± 0%  -0.38%         (p=0.000 n=10+8)
    Unicode         541k ± 0%       541k ± 0%  -0.11%        (p=0.000 n=10+10)
    GoTypes        2.09M ± 0%      2.08M ± 0%  -0.40%        (p=0.000 n=10+10)
    Compiler       9.28M ± 0%      9.24M ± 0%  -0.36%        (p=0.000 n=10+10)
    
    Size of $GOROOT/pkg/darwin_amd64 drops from 40124 KB to 40100 KB too,
    removing the zero padding as suggested by josharian.
    
    Updates #6853
    
    Change-Id: I3c557266e9325fe29c459cef8e5b8954913e7abb
    Reviewed-on: https://go-review.googlesource.com/20931Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    060a6915
gen.go 25.7 KB