• Russ Cox's avatar
    cmd/gc: add 2-, 3-, 4-word write barrier specializations · a3416cf5
    Russ Cox authored
    Assignments of 2-, 3-, and 4-word values were handled
    by individual MOV instructions (and for scalars still are).
    But if there are pointers involved, those assignments now
    go through the write barrier routine. Before this CL, they
    went to writebarrierfat, which calls memmove.
    Memmove is too much overhead for these small
    amounts of data.
    
    Instead, call writebarrierfat{2,3,4}, which are specialized
    for the specific amount of data being copied.
    Today the write barrier does not care which words are
    pointers, so size alone is enough to distinguish the cases.
    If we keep these distinctions in Go 1.5 we will need to
    expand them for all the pointer-vs-scalar possibilities,
    so the current 3 functions will become 3+7+15 = 25,
    still not a large burden (we deleted more morestack
    functions than that when we dropped segmented stacks).
    
    BenchmarkBinaryTree17           3250972583  3123910344  -3.91%
    BenchmarkFannkuch11             3067605223  2964737839  -3.35%
    BenchmarkFmtFprintfEmpty        101         96.0        -4.95%
    BenchmarkFmtFprintfString       267         235         -11.99%
    BenchmarkFmtFprintfInt          261         253         -3.07%
    BenchmarkFmtFprintfIntInt       444         402         -9.46%
    BenchmarkFmtFprintfPrefixedInt  374         346         -7.49%
    BenchmarkFmtFprintfFloat        472         449         -4.87%
    BenchmarkFmtManyArgs            1537        1476        -3.97%
    BenchmarkGobDecode              13986528    12432985    -11.11%
    BenchmarkGobEncode              13120323    12537420    -4.44%
    BenchmarkGzip                   451925758   437500578   -3.19%
    BenchmarkGunzip                 113267612   110053644   -2.84%
    BenchmarkHTTPClientServer       103151      77100       -25.26%
    BenchmarkJSONEncode             25002733    23435278    -6.27%
    BenchmarkJSONDecode             94213717    82568789    -12.36%
    BenchmarkMandelbrot200          4804246     4713070     -1.90%
    BenchmarkGoParse                4646114     4379456     -5.74%
    BenchmarkRegexpMatchEasy0_32    163         158         -3.07%
    BenchmarkRegexpMatchEasy0_1K    433         391         -9.70%
    BenchmarkRegexpMatchEasy1_32    154         138         -10.39%
    BenchmarkRegexpMatchEasy1_1K    1481        1132        -23.57%
    BenchmarkRegexpMatchMedium_32   282         270         -4.26%
    BenchmarkRegexpMatchMedium_1K   92421       86149       -6.79%
    BenchmarkRegexpMatchHard_32     5209        4718        -9.43%
    BenchmarkRegexpMatchHard_1K     158141      147921      -6.46%
    BenchmarkRevcomp                699818791   642222464   -8.23%
    BenchmarkTemplate               132402383   108269713   -18.23%
    BenchmarkTimeParse              509         478         -6.09%
    BenchmarkTimeFormat             462         456         -1.30%
    
    LGTM=r
    R=r
    CC=golang-codereviews
    https://golang.org/cl/156200043
    a3416cf5
Name
Last commit
Last update
..
Makefile Loading commit data...
align.c Loading commit data...
array.c Loading commit data...
bisonerrors Loading commit data...
bits.c Loading commit data...
builtin.c Loading commit data...
bv.c Loading commit data...
closure.c Loading commit data...
const.c Loading commit data...
cplx.c Loading commit data...
dcl.c Loading commit data...
doc.go Loading commit data...
esc.c Loading commit data...
export.c Loading commit data...
fmt.c Loading commit data...
gen.c Loading commit data...
go.errors Loading commit data...
go.h Loading commit data...
go.y Loading commit data...
init.c Loading commit data...
inl.c Loading commit data...
lex.c Loading commit data...
md5.c Loading commit data...
md5.h Loading commit data...
mkbuiltin Loading commit data...
mkbuiltin1.c Loading commit data...
mkopnames Loading commit data...
mparith1.c Loading commit data...
mparith2.c Loading commit data...
mparith3.c Loading commit data...
obj.c Loading commit data...
order.c Loading commit data...
pgen.c Loading commit data...
plive.c Loading commit data...
popt.c Loading commit data...
popt.h Loading commit data...
racewalk.c Loading commit data...
range.c Loading commit data...
reflect.c Loading commit data...
runtime.go Loading commit data...
select.c Loading commit data...
sinit.c Loading commit data...
subr.c Loading commit data...
swt.c Loading commit data...
typecheck.c Loading commit data...
unsafe.c Loading commit data...
unsafe.go Loading commit data...
walk.c Loading commit data...
y.tab.c Loading commit data...
y.tab.h Loading commit data...
yerr.h Loading commit data...