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

Function benchmarkHTMLTemplate

tests/templates_timing_test.go:71–83  ·  view source on GitHub ↗
(b *testing.B, rowsCount int)

Source from the content-addressed store, hash-verified

69}
70
71func benchmarkHTMLTemplate(b *testing.B, rowsCount int) {
72 rows := getBenchRows(rowsCount)
73 b.RunParallel(func(pb *testing.PB) {
74 bb := quicktemplate.AcquireByteBuffer()
75 for pb.Next() {
76 if err := tpl.Execute(bb, rows); err != nil {
77 b.Fatalf("unexpected error: %s", err)
78 }
79 bb.Reset()
80 }
81 quicktemplate.ReleaseByteBuffer(bb)
82 })
83}
84
85func BenchmarkTextTemplate1(b *testing.B) {
86 benchmarkTextTemplate(b, 1)

Callers 3

BenchmarkHTMLTemplate1Function · 0.85
BenchmarkHTMLTemplate10Function · 0.85
BenchmarkHTMLTemplate100Function · 0.85

Calls 5

AcquireByteBufferFunction · 0.92
ReleaseByteBufferFunction · 0.92
getBenchRowsFunction · 0.85
NextMethod · 0.80
ResetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…