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>
pull/7/head
Michael Anthony Knyszek 2023-06-27 18:46:03 +00:00 committed by Gopher Robot
parent dc2b26307f
commit 6468fc126e
3 changed files with 17 additions and 7 deletions

View File

@ -192,7 +192,7 @@ func TestSweetEndToEnd(t *testing.T) {
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},

View File

@ -109,7 +109,11 @@ func (h GoBuild) Build(pcfg *common.Config, bcfg *common.BuildConfig) error {
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

View File

@ -57,11 +57,17 @@ func (h Tile38) Build(cfg *common.Config, bcfg *common.BuildConfig) error {
}
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",