MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / BenchmarkSuggestKeywordWithCache

Function BenchmarkSuggestKeywordWithCache

pkg/errors/cache_test.go:204–217  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

202}
203
204func BenchmarkSuggestKeywordWithCache(b *testing.B) {
205 ClearSuggestionCache()
206 ResetSuggestionCacheStats()
207
208 // First call to populate cache
209 SuggestKeyword("SELCT")
210
211 b.ReportAllocs()
212 b.ResetTimer()
213 for i := 0; i < b.N; i++ {
214 // This should be a cache hit
215 _ = SuggestKeyword("SELCT")
216 }
217}
218
219func BenchmarkSuggestKeywordCacheMiss(b *testing.B) {
220 ClearSuggestionCache()

Callers

nothing calls this directly

Calls 3

ClearSuggestionCacheFunction · 0.85
SuggestKeywordFunction · 0.85

Tested by

no test coverage detected