BenchmarkDocumentManager_Concurrent benchmarks concurrent document operations
(b *testing.B)
| 426 | |
| 427 | // BenchmarkDocumentManager_Concurrent benchmarks concurrent document operations |
| 428 | func 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 |
| 446 | func BenchmarkDocument_GetWordAtPosition(b *testing.B) { |
nothing calls this directly
no test coverage detected