diff options
| author | David Chase <drchase@google.com> | 2020-03-11 20:17:14 -0400 |
|---|---|---|
| committer | David Chase <drchase@google.com> | 2020-03-12 17:37:13 +0000 |
| commit | 040855e39bb471b09f3803cbca2c8d683b2bc6dc (patch) | |
| tree | 8f499639a2e4f6db798579ac95609af22ecb0ce6 | |
| parent | 938ad552cdfdb1707acedcc641c8f8ada642644d (diff) | |
| download | go-040855e39bb471b09f3803cbca2c8d683b2bc6dc.tar.xz | |
test: restore no-gogcflags build shortcut, save time
With a clean cache on a laptop
before change
time go run run.go -- . fixedbugs
real 2m10.195s
user 3m16.547s
sys 1m52.939s
Or, before, directly after make.bash (the actual use case we care about)
time go run run.go -- . fixedbugs
real 2m8.704s
user 3m12.327s
sys 1m49.123s
after change
time go run run.go -- . fixedbugs
real 1m38.915s
user 2m38.389s
sys 1m8.490s
Tests, fortunately, still seem to pass.
Latest version of this takes the slow route for cross-compilation, which includes wasm.
Change-Id: Iad19951612defa96c4e9830bce920c5e8733834a
Reviewed-on: https://go-review.googlesource.com/c/go/+/223083
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
| -rw-r--r-- | test/run.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/run.go b/test/run.go index 6a52fe1a22..781c8d75dd 100644 --- a/test/run.go +++ b/test/run.go @@ -462,6 +462,10 @@ func goGcflags() string { return "-gcflags=all=" + os.Getenv("GO_GCFLAGS") } +func goGcflagsIsEmpty() bool { + return "" == os.Getenv("GO_GCFLAGS") +} + // run runs a test. func (t *test) run() { start := time.Now() @@ -1002,7 +1006,7 @@ func (t *test) run() { useTmp = false var out []byte var err error - if len(flags)+len(args) == 0 && goGcflags() == "" && !*linkshared { + if len(flags)+len(args) == 0 && goGcflagsIsEmpty() && !*linkshared && goarch == runtime.GOARCH && goos == runtime.GOOS { // If we're not using special go command flags, // skip all the go command machinery. // This avoids any time the go command would |
