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

Function BenchmarkDocumentManager_Concurrent

pkg/lsp/handler_bench_test.go:428–443  ·  view source on GitHub ↗

BenchmarkDocumentManager_Concurrent benchmarks concurrent document operations

(b *testing.B)

Source from the content-addressed store, hash-verified

426
427// BenchmarkDocumentManager_Concurrent benchmarks concurrent document operations
428func BenchmarkDocumentManager_Concurrent(b *testing.B) {
429 dm := NewDocumentManager()
430
431 b.ReportAllocs()
432 b.ResetTimer()
433 b.RunParallel(func(pb *testing.PB) {
434 i := 0
435 for pb.Next() {
436 uri := fmt.Sprintf("file:///test%d.sql", i%100)
437 dm.Open(uri, "sql", i, "SELECT * FROM users")
438 _, _ = dm.Get(uri)
439 dm.Close(uri)
440 i++
441 }
442 })
443}
444
445// BenchmarkDocument_GetWordAtPosition benchmarks word extraction at position
446func BenchmarkDocument_GetWordAtPosition(b *testing.B) {

Callers

nothing calls this directly

Calls 4

OpenMethod · 0.95
GetMethod · 0.95
CloseMethod · 0.95
NewDocumentManagerFunction · 0.85

Tested by

no test coverage detected