diff options
author | Josh Bleecher Snyder <josharian@gmail.com> | 2014-06-17 09:07:18 -0700 |
---|---|---|
committer | Josh Bleecher Snyder <josharian@gmail.com> | 2014-06-17 09:07:18 -0700 |
commit | 63393faedf65b5b3719965cd4dead9a634be352f (patch) | |
tree | 72d46d4cc54cbccb110401e5e5c3cc209311e609 /test/chan | |
parent | 4f14d1520253bd5d3dc19ab8b8668308d5bdcd64 (diff) | |
download | go-63393faedf65b5b3719965cd4dead9a634be352f.tar.gz go-63393faedf65b5b3719965cd4dead9a634be352f.zip |
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
Diffstat (limited to 'test/chan')
-rw-r--r-- | test/chan/select5.go | 6 |
1 files changed, 3 insertions, 3 deletions
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) |