blob: 1c64f1953df48854b8a4d79d0ccd333550f3a912 [file] [log] [blame]
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package fuzzy_test
import (
"testing"
. "golang.org/x/tools/gopls/internal/fuzzy"
)
func BenchmarkSelf_Matcher(b *testing.B) {
idents := collectIdentifiers(b)
patterns := generatePatterns()
for i := 0; i < b.N; i++ {
for _, pattern := range patterns {
sm := NewMatcher(pattern)
for _, ident := range idents {
_ = sm.Score(ident)
}
}
}
}
func BenchmarkSelf_SymbolMatcher(b *testing.B) {
idents := collectIdentifiers(b)
patterns := generatePatterns()
for i := 0; i < b.N; i++ {
for _, pattern := range patterns {
sm := NewSymbolMatcher(pattern)
for _, ident := range idents {
_, _ = sm.Match([]string{ident})
}
}
}
}