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

Function BenchmarkStringEnd_NoEscape_Long

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

Source from the content-addressed store, hash-verified

28}
29
30func BenchmarkStringEnd_NoEscape_Long(b *testing.B) {
31 // 128-byte string value, no escapes — exercises the SIMD fast path.
32 data := []byte(strings.Repeat("a", 128) + `"`)
33 b.SetBytes(int64(len(data)))
34 b.ResetTimer()
35 for i := 0; i < b.N; i++ {
36 _, _ = stringEnd(data)
37 }
38}
39
40func BenchmarkStringEnd_WithEscape(b *testing.B) {
41 // Slow path: contains an escaped quote so the per-byte walker runs.

Callers

nothing calls this directly

Calls 1

stringEndFunction · 0.85

Tested by

no test coverage detected