MCPcopy
hub / github.com/valyala/quicktemplate / benchmarkAppendJSONString

Function benchmarkAppendJSONString

jsonstring_timing_test.go:17–26  ·  view source on GitHub ↗
(b *testing.B, s string)

Source from the content-addressed store, hash-verified

15}
16
17func benchmarkAppendJSONString(b *testing.B, s string) {
18 b.ReportAllocs()
19 b.SetBytes(int64(len(s)))
20 b.RunParallel(func(pb *testing.PB) {
21 var buf []byte
22 for pb.Next() {
23 buf = AppendJSONString(buf[:0], s, true)
24 }
25 })
26}
27
28func BenchmarkAppendJSONStringViaStrconv(b *testing.B) {
29 b.Run("no-special-chars", func(b *testing.B) {

Callers 1

Calls 2

AppendJSONStringFunction · 0.85
NextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…