• Austin Clements's avatar
    cmd/link: use BestSpeed for DWARF compression · 12ed0dde
    Austin Clements authored
    DWARF compression accounts for roughly 30% of the linker's time. This
    CL switches from DefaultCompression to BestSpeed, which virtually
    eliminates this time. This roughly halves the overhead of handling
    DWARF in the linker:
    
    name \ time/op         nodwarf     dwarf        dwarf-speed
    BuildCmdGoAll          10.0s ±11%   10.6s ± 5%   10.8s ± 5%
                 nodwarf                  +6.41%       +8.03%
                   dwarf                                 ~
    LinkCmdGo              626ms ± 5%  1096ms ± 2%   860ms ± 2%
                 nodwarf                 +75.17%      +37.36%
                   dwarf                              -21.59%
    
    Previously, enabling DWARF had a 75% overhead in link time for cmd/go.
    This change reduces this overhead to 37% (a 22% reduction).
    
    The effect on binary size is minimal compared to DefaultCompression,
    and still substantially better than no compression:
    
                 cmd/go bytes
    nodwarf      10106953
    dwarf        12159049 nodwarf+20%
    dwarf-speed  12408905 nodwarf+23%
    dwarf-nozlib 17766473 nodwarf+76%
    
    Updates #26318.
    
    Change-Id: I33bb7caa038a2753c29104501663daf4839e7054
    Reviewed-on: https://go-review.googlesource.com/123356
    Run-TryBot: Austin Clements <austin@google.com>
    Reviewed-by: 's avatarHeschi Kreinick <heschi@google.com>
    12ed0dde
Name
Last commit
Last update
..
testdata Loading commit data...
ar.go Loading commit data...
config.go Loading commit data...
data.go Loading commit data...
deadcode.go Loading commit data...
decodesym.go Loading commit data...
dwarf.go Loading commit data...
dwarf_test.go Loading commit data...
elf.go Loading commit data...
go.go Loading commit data...
ld.go Loading commit data...
ld_test.go Loading commit data...
lib.go Loading commit data...
link.go Loading commit data...
macho.go Loading commit data...
macho_combine_dwarf.go Loading commit data...
main.go Loading commit data...
nooptcgolink_test.go Loading commit data...
outbuf.go Loading commit data...
pcln.go Loading commit data...
pe.go Loading commit data...
sym.go Loading commit data...
symtab.go Loading commit data...
typelink.go Loading commit data...
util.go Loading commit data...