• Josh Bleecher Snyder's avatar
    cmd/internal/dwarf: remove global encbuf · f9783011
    Josh Bleecher Snyder authored
    The global encbuf helped avoid allocations.
    It is incompatible with a concurrent backend.
    To avoid a performance regression while removing it,
    introduce two optimizations.
    First, re-use a buffer in dwarf.PutFunc.
    Second, avoid a buffer entirely when the int
    being encoded fits in seven bits, which is about 75%
    of the time.
    
    Passes toolstash-check.
    
    Updates #15756
    
    
    name       old alloc/op    new alloc/op    delta
    Template      40.6MB ± 0%     40.6MB ± 0%  -0.08%  (p=0.001 n=8+9)
    Unicode       29.9MB ± 0%     29.9MB ± 0%    ~     (p=0.068 n=8+10)
    GoTypes        116MB ± 0%      116MB ± 0%  +0.05%  (p=0.043 n=10+9)
    SSA            864MB ± 0%      864MB ± 0%  +0.01%  (p=0.010 n=10+9)
    Flate         25.8MB ± 0%     25.8MB ± 0%    ~     (p=0.353 n=10+10)
    GoParser      32.2MB ± 0%     32.2MB ± 0%    ~     (p=0.353 n=10+10)
    Reflect       80.2MB ± 0%     80.2MB ± 0%    ~     (p=0.165 n=10+10)
    Tar           27.0MB ± 0%     26.9MB ± 0%    ~     (p=0.143 n=10+10)
    XML           42.8MB ± 0%     42.8MB ± 0%    ~     (p=0.400 n=10+9)
    
    name       old allocs/op   new allocs/op   delta
    Template        398k ± 0%       397k ± 0%  -0.20%  (p=0.002 n=8+9)
    Unicode         320k ± 0%       321k ± 1%    ~     (p=0.122 n=8+10)
    GoTypes        1.16M ± 0%      1.17M ± 0%    ~     (p=0.053 n=10+9)
    SSA            7.65M ± 0%      7.65M ± 0%    ~     (p=0.122 n=10+8)
    Flate           240k ± 1%       240k ± 1%    ~     (p=0.243 n=10+9)
    GoParser        322k ± 1%       322k ± 1%    ~     (p=0.481 n=10+10)
    Reflect        1.00M ± 0%      1.00M ± 0%    ~     (p=0.211 n=9+10)
    Tar             256k ± 0%       255k ± 1%    ~     (p=0.052 n=10+10)
    XML             400k ± 1%       400k ± 0%    ~     (p=0.631 n=10+10)
    
    
    Change-Id: Ia39d9de09232fdbfc9c9cec14587bbf6939c9492
    Reviewed-on: https://go-review.googlesource.com/38713
    Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    f9783011
Name
Last commit
Last update
..
archive Loading commit data...
bufio Loading commit data...
builtin Loading commit data...
bytes Loading commit data...
cmd Loading commit data...
compress Loading commit data...
container Loading commit data...
context Loading commit data...
crypto Loading commit data...
database/sql Loading commit data...
debug Loading commit data...
encoding Loading commit data...
errors Loading commit data...
expvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
hash Loading commit data...
html Loading commit data...
image Loading commit data...
index/suffixarray Loading commit data...
internal Loading commit data...
io Loading commit data...
log Loading commit data...
math Loading commit data...
mime Loading commit data...
net Loading commit data...
os Loading commit data...
path Loading commit data...
plugin Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
runtime Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
testing Loading commit data...
text Loading commit data...
time Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...
vendor/golang_org/x Loading commit data...
Make.dist Loading commit data...
all.bash Loading commit data...
all.bat Loading commit data...
all.rc Loading commit data...
androidtest.bash Loading commit data...
bootstrap.bash Loading commit data...
buildall.bash Loading commit data...
clean.bash Loading commit data...
clean.bat Loading commit data...
clean.rc Loading commit data...
cmp.bash Loading commit data...
iostest.bash Loading commit data...
make.bash Loading commit data...
make.bat Loading commit data...
make.rc Loading commit data...
naclmake.bash Loading commit data...
nacltest.bash Loading commit data...
race.bash Loading commit data...
race.bat Loading commit data...
run.bash Loading commit data...
run.bat Loading commit data...
run.rc Loading commit data...