Commit 0ea20bc9 authored by Keith Randall's avatar Keith Randall

cmd/6g: inline copies of up to 4 words in length.

This change fixes a serious performance regression
with reflect.Value growing to 4 words instead of 3.
The json benchmark was ~50% slower, with this change
it is ~5% slower (and the binary is 0.5% larger).

Longer term, we probably need to rethink our copy
generation.  Using REP is really expensive time-wise.
But inlining the copy grows the binary.

R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/44990043
parent 1cc2ff8f
......@@ -1513,7 +1513,7 @@ componentgen(Node *nr, Node *nl)
fatal("componentgen: not a TFIELD: %lT", t);
fldcount++;
}
if(fldcount == 0 || fldcount > 3)
if(fldcount == 0 || fldcount > 4)
goto no;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment