(b *testing.B, rowsCount int)
| 95 | } |
| 96 | |
| 97 | func benchmarkTextTemplate(b *testing.B, rowsCount int) { |
| 98 | rows := getBenchRows(rowsCount) |
| 99 | b.RunParallel(func(pb *testing.PB) { |
| 100 | bb := quicktemplate.AcquireByteBuffer() |
| 101 | for pb.Next() { |
| 102 | if err := textTpl.Execute(bb, rows); err != nil { |
| 103 | b.Fatalf("unexpected error: %s", err) |
| 104 | } |
| 105 | bb.Reset() |
| 106 | } |
| 107 | quicktemplate.ReleaseByteBuffer(bb) |
| 108 | }) |
| 109 | } |
| 110 | |
| 111 | func getBenchRows(n int) []templates.BenchRow { |
| 112 | rows := make([]templates.BenchRow, n) |
no test coverage detected
searching dependent graphs…