internal/gen: work around long string concatenation.

The compiler has trouble compiling the concatenation of many strings, s0 + s1 +
s2 + ... + sN, for large N. We insert redundant, explicit parentheses to work
around that, lowering the N at any given step.

Some before/after's on GOOS=linux GOARCH=amd64 from
/usr/bin/time -v go install golang.org/x/text/unicode/runenames

Elapsed (wall clock) time (h:mm:ss or m:ss): 0:02.21
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.33

Maximum resident set size (kbytes): 4414556
Maximum resident set size (kbytes): 135040

Minor (reclaiming a frame) page faults: 1071428
Minor (reclaiming a frame) page faults: 40242

Fixes golang/go#18078

Change-Id: I6f0bfcc26ae4f1c8fea010a2ee3d815567426b2d
Reviewed-on: https://go-review.googlesource.com/33598
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2 files changed