From 63393faedf65b5b3719965cd4dead9a634be352f Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Tue, 17 Jun 2014 09:07:18 -0700 Subject: [PATCH] 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 --- test/chan/select5.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/chan/select5.go b/test/chan/select5.go index f72cfe4b461..1081cb29662 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)