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

Function benchmarkMarshalXMLQuickTemplate

tests/marshal_timing_test.go:170–180  ·  view source on GitHub ↗
(b *testing.B, n int)

Source from the content-addressed store, hash-verified

168}
169
170func benchmarkMarshalXMLQuickTemplate(b *testing.B, n int) {
171 d := newTemplatesData(n)
172 b.RunParallel(func(pb *testing.PB) {
173 bb := quicktemplate.AcquireByteBuffer()
174 for pb.Next() {
175 d.WriteXML(bb)
176 bb.Reset()
177 }
178 quicktemplate.ReleaseByteBuffer(bb)
179 })
180}
181
182func newTemplatesData(n int) *templates.MarshalData {
183 var rows []templates.MarshalRow

Calls 6

AcquireByteBufferFunction · 0.92
ReleaseByteBufferFunction · 0.92
newTemplatesDataFunction · 0.85
NextMethod · 0.80
WriteXMLMethod · 0.80
ResetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…