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

Function BenchmarkDocumentManager_Update

pkg/lsp/handler_bench_test.go:412–425  ·  view source on GitHub ↗

BenchmarkDocumentManager_Update benchmarks document updates

(b *testing.B)

Source from the content-addressed store, hash-verified

410
411// BenchmarkDocumentManager_Update benchmarks document updates
412func BenchmarkDocumentManager_Update(b *testing.B) {
413 dm := NewDocumentManager()
414 dm.Open("file:///test.sql", "sql", 1, "SELECT * FROM users")
415
416 changes := []TextDocumentContentChangeEvent{
417 {Text: "SELECT id, name FROM users WHERE active = true"},
418 }
419
420 b.ReportAllocs()
421 b.ResetTimer()
422 for i := 0; i < b.N; i++ {
423 dm.Update("file:///test.sql", i+2, changes)
424 }
425}
426
427// BenchmarkDocumentManager_Concurrent benchmarks concurrent document operations
428func BenchmarkDocumentManager_Concurrent(b *testing.B) {

Callers

nothing calls this directly

Calls 3

OpenMethod · 0.95
UpdateMethod · 0.95
NewDocumentManagerFunction · 0.85

Tested by

no test coverage detected