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

Function BenchmarkOffsetToLineColumn

pkg/lsp/handler_bench_test.go:497–512  ·  view source on GitHub ↗

BenchmarkOffsetToLineColumn benchmarks offset to line/column conversion

(b *testing.B)

Source from the content-addressed store, hash-verified

495
496// BenchmarkOffsetToLineColumn benchmarks offset to line/column conversion
497func BenchmarkOffsetToLineColumn(b *testing.B) {
498 content := `SELECT id, name, email
499FROM users
500WHERE active = true
501ORDER BY name
502LIMIT 10`
503
504 offsets := []int{0, 10, 25, 50, 75, 100}
505
506 b.ReportAllocs()
507 b.ResetTimer()
508 for i := 0; i < b.N; i++ {
509 offset := offsets[i%len(offsets)]
510 _, _ = offsetToLineColumn(content, offset)
511 }
512}
513
514// setupTestServer creates a test server with mock I/O
515func setupTestServer() *Server {

Callers

nothing calls this directly

Calls 1

offsetToLineColumnFunction · 0.85

Tested by

no test coverage detected