MCPcopy Create free account
hub / github.com/buger/jsonparser / BenchmarkStringEnd_WithEscape

Function BenchmarkStringEnd_WithEscape

optimization_bench_test.go:40–48  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

38}
39
40func BenchmarkStringEnd_WithEscape(b *testing.B) {
41 // Slow path: contains an escaped quote so the per-byte walker runs.
42 data := []byte(`hello \"world"`)
43 b.SetBytes(int64(len(data)))
44 b.ResetTimer()
45 for i := 0; i < b.N; i++ {
46 _, _ = stringEnd(data)
47 }
48}
49
50// --- tokenEnd ---------------------------------------------------------------
51// Common case: a bare scalar value (number, boolean, null) terminated by a

Callers

nothing calls this directly

Calls 1

stringEndFunction · 0.85

Tested by

no test coverage detected