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

Function BenchmarkGet_StringValue_NoEscape

optimization_bench_test.go:86–93  ·  view source on GitHub ↗

--- end-to-end Get with a string value ------------------------------------- Verifies that stringEnd's fast path actually shows up in a realistic call.

(b *testing.B)

Source from the content-addressed store, hash-verified

84// Verifies that stringEnd's fast path actually shows up in a realistic call.
85
86func BenchmarkGet_StringValue_NoEscape(b *testing.B) {
87 data := []byte(`{"key":"` + strings.Repeat("a", 128) + `"}`)
88 b.SetBytes(int64(len(data)))
89 b.ResetTimer()
90 for i := 0; i < b.N; i++ {
91 _, _, _, _ = Get(data, "key")
92 }
93}

Callers

nothing calls this directly

Calls 1

GetFunction · 0.85

Tested by

no test coverage detected