mirror of
https://github.com/golang/go
synced 2024-11-23 00:10:07 -07:00
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
This commit is contained in:
parent
4f14d15202
commit
63393faedf
@ -27,17 +27,17 @@ 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, `}`)
|
||||
}
|
||||
}
|
||||
|
||||
do(recv)
|
||||
do(send)
|
||||
|
Loading…
Reference in New Issue
Block a user