• Russ Cox's avatar
    cmd/internal/gc: clean up componentgen · 35b1dcc2
    Russ Cox authored
    This is primarily about making the code clearer, but as part of the cleanup
    componentgen is now much more consistent about what it does and does
    not attempt.
    
    The new limit is to 8 move instructions.
    
    The old limit was either 3 or 4 small things but in the details it was
    quite inconsistent: ints, interfaces, strings, and slices all counted as small;
    it handled a struct containing two ints, but not a struct containing a struct
    containing two ints; it handled slices and interfaces and a struct containing
    a slice but not a struct containing an interface; and so on.
    
    The new code runs at about the same speed as the old code if limited to 4 moves,
    but that's much more restrictive when the pieces are strings or interfaces.
    With the limit raised to 8 moves, this CL is sometimes a significant improvement:
    
    benchmark                          old ns/op      new ns/op      delta
    BenchmarkBinaryTree17              4361174290     4362870005     +0.04%
    BenchmarkFannkuch11                3008201483     2974408533     -1.12%
    BenchmarkFmtFprintfEmpty           79.0           79.5           +0.63%
    BenchmarkFmtFprintfString          281            261            -7.12%
    BenchmarkFmtFprintfInt             264            262            -0.76%
    BenchmarkFmtFprintfIntInt          447            443            -0.89%
    BenchmarkFmtFprintfPrefixedInt     354            361            +1.98%
    BenchmarkFmtFprintfFloat           500            452            -9.60%
    BenchmarkFmtManyArgs               1688           1693           +0.30%
    BenchmarkGobDecode                 11718456       11741179       +0.19%
    BenchmarkGobEncode                 10144620       10161627       +0.17%
    BenchmarkGzip                      437631642      435271877      -0.54%
    BenchmarkGunzip                    109468858      110173606      +0.64%
    BenchmarkHTTPClientServer          76248          75362          -1.16%
    BenchmarkJSONEncode                24160474       23753091       -1.69%
    BenchmarkJSONDecode                84470041       82902026       -1.86%
    BenchmarkMandelbrot200             4676857        4687040        +0.22%
    BenchmarkGoParse                   4954602        4923965        -0.62%
    BenchmarkRegexpMatchEasy0_32       151            151            +0.00%
    BenchmarkRegexpMatchEasy0_1K       450            452            +0.44%
    BenchmarkRegexpMatchEasy1_32       131            130            -0.76%
    BenchmarkRegexpMatchEasy1_1K       713            695            -2.52%
    BenchmarkRegexpMatchMedium_32      227            218            -3.96%
    BenchmarkRegexpMatchMedium_1K      63911          62966          -1.48%
    BenchmarkRegexpMatchHard_32        3163           3026           -4.33%
    BenchmarkRegexpMatchHard_1K        93985          90266          -3.96%
    BenchmarkRevcomp                   650697093      649211600      -0.23%
    BenchmarkTemplate                  107049170      106804076      -0.23%
    BenchmarkTimeParse                 448            452            +0.89%
    BenchmarkTimeFormat                468            460            -1.71%
    
    Change-Id: I08563133883e88bb9db9e9e4dee438a5af2787da
    Reviewed-on: https://go-review.googlesource.com/9004Reviewed-by: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
    35b1dcc2
Name
Last commit
Last update
..
big Loading commit data...
builtin Loading commit data...
align.go Loading commit data...
builtin.go Loading commit data...
bv.go Loading commit data...
cgen.go Loading commit data...
closure.go Loading commit data...
const.go Loading commit data...
cplx.go Loading commit data...
dcl.go Loading commit data...
esc.go Loading commit data...
export.go Loading commit data...
fmt.go Loading commit data...
gen.go Loading commit data...
go.errors Loading commit data...
go.go Loading commit data...
go.y Loading commit data...
gsubr.go Loading commit data...
init.go Loading commit data...
inl.go Loading commit data...
lex.go Loading commit data...
mkbuiltin.go Loading commit data...
mparith2.go Loading commit data...
mparith3.go Loading commit data...
obj.go Loading commit data...
opnames.go Loading commit data...
order.go Loading commit data...
pgen.go Loading commit data...
plive.go Loading commit data...
popt.go Loading commit data...
racewalk.go Loading commit data...
range.go Loading commit data...
reflect.go Loading commit data...
reg.go Loading commit data...
select.go Loading commit data...
sinit.go Loading commit data...
subr.go Loading commit data...
swt.go Loading commit data...
syntax.go Loading commit data...
typecheck.go Loading commit data...
unsafe.go Loading commit data...
util.go Loading commit data...
walk.go Loading commit data...
y.go Loading commit data...
y.output Loading commit data...
yaccerrors.go Loading commit data...
yymsg.go Loading commit data...