From: Josh Bleecher Snyder Date: Tue, 17 Jun 2014 16:07:18 +0000 (-0700) Subject: test: speed up chan/select5 X-Git-Tag: go1.4beta1~1274 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=63393faedf65b5b3719965cd4dead9a634be352f;p=gostls13.git test: speed up chan/select5 No functional changes. Generating shorter functions improves compilation time. On my laptop, this test's running time goes from 5.5s to 1.5s; the wall clock time to run all tests goes down 1s. On Raspberry Pi, this CL cuts 50s off the wall clock time to run all tests. Fixes #7503. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/72590045 --- diff --git a/test/chan/select5.go b/test/chan/select5.go index f72cfe4b46..1081cb2966 100644 --- a/test/chan/select5.go +++ b/test/chan/select5.go @@ -27,16 +27,16 @@ func main() { fmt.Fprintln(out, header) a := new(arg) - // Generate each kind of test as a separate function to avoid + // Generate each test as a separate function to avoid // hitting the 6g optimizer with one enormous function. // If we name all the functions init we don't have to // maintain a list of which ones to run. do := func(t *template.Template) { - fmt.Fprintln(out, `func init() {`) for ; next(); a.reset() { + fmt.Fprintln(out, `func init() {`) run(t, a, out) + fmt.Fprintln(out, `}`) } - fmt.Fprintln(out, `}`) } do(recv)