Commit 63393fae authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

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
parent 4f14d152
...@@ -27,16 +27,16 @@ func main() { ...@@ -27,16 +27,16 @@ func main() {
fmt.Fprintln(out, header) fmt.Fprintln(out, header)
a := new(arg) 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. // hitting the 6g optimizer with one enormous function.
// If we name all the functions init we don't have to // If we name all the functions init we don't have to
// maintain a list of which ones to run. // maintain a list of which ones to run.
do := func(t *template.Template) { do := func(t *template.Template) {
fmt.Fprintln(out, `func init() {`)
for ; next(); a.reset() { for ; next(); a.reset() {
fmt.Fprintln(out, `func init() {`)
run(t, a, out) run(t, a, out)
fmt.Fprintln(out, `}`)
} }
fmt.Fprintln(out, `}`)
} }
do(recv) do(recv)
......
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