Skip to content

Commit

Permalink
gopls: add google-cloud-go as a benchmark repo
Browse files Browse the repository at this point in the history
This repo is large, and exercises use-cases with many workspace modules.

For golang/go#60089

Change-Id: I93b9c99ce52bd7ae25f65fdb9bf0568c25375411
Reviewed-on: https://go-review.googlesource.com/c/tools/+/494096
Reviewed-by: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
  • Loading branch information
findleyr committed May 10, 2023
1 parent d799eba commit 4ed7de1
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions gopls/internal/regtest/bench/definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func BenchmarkDefinition(b *testing.B) {
regexp string
}{
{"istio", "pkg/config/model.go", `gogotypes\.(MarshalAny)`},
{"google-cloud-go", "httpreplay/httpreplay.go", `proxy\.(ForRecording)`},
{"kubernetes", "pkg/controller/lookup_cache.go", `hashutil\.(DeepHashObject)`},
{"kuma", "api/generic/insights.go", `proto\.(Message)`},
{"pkgsite", "internal/log/log.go", `derrors\.(Wrap)`},
Expand Down
1 change: 1 addition & 0 deletions gopls/internal/regtest/bench/didchange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var didChangeTests = []struct {
repo string
file string
}{
{"google-cloud-go", "httpreplay/httpreplay.go"},
{"istio", "pkg/fuzz/util.go"},
{"kubernetes", "pkg/controller/lookup_cache.go"},
{"kuma", "api/generic/insights.go"},
Expand Down
1 change: 1 addition & 0 deletions gopls/internal/regtest/bench/hover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func BenchmarkHover(b *testing.B) {
file string
regexp string
}{
{"google-cloud-go", "httpreplay/httpreplay.go", `proxy\.(ForRecording)`},
{"istio", "pkg/config/model.go", `gogotypes\.(MarshalAny)`},
{"kubernetes", "pkg/apis/core/types.go", "type (Pod)"},
{"kuma", "api/generic/insights.go", `proto\.(Message)`},
Expand Down
1 change: 1 addition & 0 deletions gopls/internal/regtest/bench/implementations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ func BenchmarkImplementations(b *testing.B) {
file string
regexp string
}{
{"google-cloud-go", "httpreplay/httpreplay.go", `type (Recorder)`},
{"istio", "pkg/config/mesh/watcher.go", `type (Watcher)`},
{"kubernetes", "pkg/controller/lookup_cache.go", `objectWithMeta`},
{"kuma", "api/generic/insights.go", `type (Insight)`},
Expand Down
7 changes: 4 additions & 3 deletions gopls/internal/regtest/bench/iwl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ func BenchmarkInitialWorkspaceLoad(b *testing.B) {
repo string
file string
}{
{"tools", "internal/lsp/cache/snapshot.go"},
{"google-cloud-go", "httpreplay/httpreplay.go"},
{"istio", "pkg/fuzz/util.go"},
{"kubernetes", "pkg/controller/lookup_cache.go"},
{"kuma", "api/generic/insights.go"},
{"pkgsite", "internal/frontend/server.go"},
{"starlark", "starlark/eval.go"},
{"istio", "pkg/fuzz/util.go"},
{"kuma", "api/generic/insights.go"},
{"tools", "internal/lsp/cache/snapshot.go"},
}

for _, test := range tests {
Expand Down
1 change: 1 addition & 0 deletions gopls/internal/regtest/bench/references_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ func BenchmarkReferences(b *testing.B) {
file string
regexp string
}{
{"google-cloud-go", "httpreplay/httpreplay.go", `func (NewRecorder)`},
{"istio", "pkg/config/model.go", "type (Meta)"},
{"kubernetes", "pkg/controller/lookup_cache.go", "type (objectWithMeta)"},
{"kuma", "pkg/events/interfaces.go", "type (Event)"},
Expand Down
3 changes: 2 additions & 1 deletion gopls/internal/regtest/bench/rename_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ func BenchmarkRename(b *testing.B) {
regexp string
baseName string
}{
{"google-cloud-go", "httpreplay/httpreplay.go", `func (NewRecorder)`, "NewRecorder"},
{"istio", "pkg/config/model.go", `(Namespace) string`, "Namespace"},
{"kubernetes", "pkg/controller/lookup_cache.go", `hashutil\.(DeepHashObject)`, "DeepHashObject"},
{"kuma", "pkg/events/interfaces.go", `Delete`, "Delete"},
{"istio", "pkg/config/model.go", `(Namespace) string`, "Namespace"},
{"pkgsite", "internal/log/log.go", `func (Infof)`, "Infof"},
{"starlark", "starlark/eval.go", `Program\) (Filename)`, "Filename"},
{"tools", "internal/lsp/cache/snapshot.go", `meta \*(metadataGraph)`, "metadataGraph"},
Expand Down
8 changes: 8 additions & 0 deletions gopls/internal/regtest/bench/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ import (
// These repos were selected to represent a variety of different types of
// codebases.
var repos = map[string]*repo{
// google-cloud-go has 145 workspace modules (!), and is quite large.
"google-cloud-go": {
name: "google-cloud-go",
url: "https://github.com/googleapis/google-cloud-go.git",
commit: "07da765765218debf83148cc7ed8a36d6e8921d5",
inDir: flag.String("cloud_go_dir", "", "if set, reuse this directory as google-cloud-go@07da7657"),
},

// Used by x/benchmarks; large.
"istio": {
name: "istio",
Expand Down

0 comments on commit 4ed7de1

Please sign in to comment.