sweet: make tile38 and go-build with -short even shorter
-short is not meant to be used for benchmarking; just for testing and
debugging.
Change tile38 to run with a bare (empty) database, since a substantial
amount of time is spent on loading the database from disk. The lack of a
database also means that the tile38 server uses substantially less
memory, so we can let it run in parallel with more tasks in the
end-to-end test.
Change go-build to not do a first build of the target package during
Sweet's build step: it means the results won't be as useful since
they'll include downloading packages, but in -short mode it doesn't
matter.
Change-Id: I9e3559c4077fff696a374b97f91491783a26e5ac
Reviewed-on: https://go-review.googlesource.com/c/benchmarks/+/506559
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
diff --git a/sweet/cmd/sweet/integration_test.go b/sweet/cmd/sweet/integration_test.go
index a3fb992..e38d916 100644
--- a/sweet/cmd/sweet/integration_test.go
+++ b/sweet/cmd/sweet/integration_test.go
@@ -192,7 +192,7 @@
sema := semaphore.NewWeighted(8)
var wg sync.WaitGroup
for i, shard := range []shard{
- {"tile38", 4},
+ {"tile38", 2},
{"go-build", 4},
{"biogo-igor", 1},
{"biogo-krishna", 1},
diff --git a/sweet/harnesses/go-build.go b/sweet/harnesses/go-build.go
index 485ae73..cb78cf2 100644
--- a/sweet/harnesses/go-build.go
+++ b/sweet/harnesses/go-build.go
@@ -109,7 +109,11 @@
if err != nil {
return err
}
-
+ if bcfg.Short {
+ // Short mode isn't intended to produce good benchmark results;
+ // it's meant for testing and debugging. Skip the additional build step.
+ continue
+ }
// Build the benchmark once, pulling in any requisite packages.
//
// Run the go tool with ExecEnv, as that is what we will use
diff --git a/sweet/harnesses/tile38.go b/sweet/harnesses/tile38.go
index 4b84c7a..db626b2 100644
--- a/sweet/harnesses/tile38.go
+++ b/sweet/harnesses/tile38.go
@@ -57,11 +57,17 @@
}
func (h Tile38) Run(cfg *common.Config, rcfg *common.RunConfig) error {
- // Make sure all the data passed to the server is writable.
- // The server needs to be able to open its persistent storage as read-write.
- dataPath := filepath.Join(rcfg.AssetsDir, "data")
- if err := makeWriteable(dataPath); err != nil {
- return err
+ var dataPath string
+ if rcfg.Short {
+ // Don't load the real data for short mode. It takes a long time.
+ dataPath = filepath.Join(rcfg.TmpDir, "data-empty-fake")
+ } else {
+ // Make sure all the data passed to the server is writable.
+ // The server needs to be able to open its persistent storage as read-write.
+ dataPath = filepath.Join(rcfg.AssetsDir, "data")
+ if err := makeWriteable(dataPath); err != nil {
+ return err
+ }
}
args := append(rcfg.Args, []string{
"-host", "127.0.0.1",