BenchmarkDocumentManager_Update benchmarks document updates
(b *testing.B)
| 410 | |
| 411 | // BenchmarkDocumentManager_Update benchmarks document updates |
| 412 | func 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 |
| 428 | func BenchmarkDocumentManager_Concurrent(b *testing.B) { |
nothing calls this directly
no test coverage detected