| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
package bench |
| 6 |
|
| 7 |
import ( |
| 8 |
"testing" |
| 9 |
|
| 10 |
. "golang.org/x/tools/gopls/internal/test/integration" |
| 11 |
"golang.org/x/tools/gopls/internal/test/integration/fake" |
| 12 |
) |
| 13 |
|
| 14 |
func BenchmarkSemanticTokens(b *testing.B) { |
| 15 |
env := getRepo(b, "tools").newEnv(b, fake.EditorConfig{ |
| 16 |
Settings: map[string]any{ |
| 17 |
"semanticTokens": true, |
| 18 |
}, |
| 19 |
}, "SemanticTokens", false) |
| 20 |
|
| 21 |
env.Await(InitialWorkspaceLoad) |
| 22 |
|
| 23 |
env.AfterChange() |
| 24 |
|
| 25 |
const path = "internal/lsp/cache/snapshot.go" |
| 26 |
env.OpenFile(path) |
| 27 |
|
| 28 |
for b.Loop() { |
| 29 |
env.SemanticTokensFull(path) |
| 30 |
} |
| 31 |
} |