• Russ Cox's avatar
    cmd/compile, cmd/link: eliminate string merging pass · 21af2d39
    Russ Cox authored
    Deleting the string merging pass makes the linker 30-35% faster
    but makes jujud (using the github.com/davecheney/benchjuju snapshot) 2.5% larger.
    Two optimizations bring the space overhead down to 0.6%.
    
    First, change the default alignment for string data to 1 byte.
    (It was previously defaulting to larger amounts, usually pointer width.)
    
    Second, write out the type string for T (usually a bigger expression) as "*T"[1:],
    so that the type strings for T and *T share storage.
    
    Combined, these obtain the bulk of the benefit of string merging
    at essentially no cost. The remaining benefit from string merging
    is not worth the excessive cost, so delete it.
    
    As penance for making the jujud binary 0.6% larger,
    the next CL in this sequence trims the reflect functype
    information enough to make the jujud binary overall 0.75% smaller
    (that is, that CL has a net -1.35% effect).
    
    For #6853.
    Fixes #14648.
    
    Change-Id: I3fdd74c85410930c36bb66160ca4174ed540fc6e
    Reviewed-on: https://go-review.googlesource.com/20334Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Russ Cox <rsc@golang.org>
    21af2d39
link.go 20.3 KB