mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-23 09:43:32 +00:00
tpl: Fix broken benchmarks
But that did not explain issue #2935: ``` BenchmarkPartial-4 200000 6452 ns/op 1040 B/op 30 allocs/op BenchmarkPartialCached-4 500000 4104 ns/op 544 B/op 14 allocs/op BenchmarkPartialCachedVariants-4 500000 3398 ns/op 624 B/op 17 allocs/op ```
This commit is contained in:
parent
92ba7219dc
commit
85c7578313
1 changed files with 2 additions and 0 deletions
|
@ -2833,6 +2833,7 @@ func TestPartialCached(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkPartial(b *testing.B) {
|
func BenchmarkPartial(b *testing.B) {
|
||||||
|
tstInitTemplates()
|
||||||
tmpl, err := New(logger).New("testroot").Parse(`{{ partial "bench1" . }}`)
|
tmpl, err := New(logger).New("testroot").Parse(`{{ partial "bench1" . }}`)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
b.Fatalf("unable to create new html template: %s", err)
|
b.Fatalf("unable to create new html template: %s", err)
|
||||||
|
@ -2852,6 +2853,7 @@ func BenchmarkPartial(b *testing.B) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkPartialCached(b *testing.B) {
|
func BenchmarkPartialCached(b *testing.B) {
|
||||||
|
tstInitTemplates()
|
||||||
tmpl, err := New(logger).New("testroot").Parse(`{{ partialCached "bench1" . }}`)
|
tmpl, err := New(logger).New("testroot").Parse(`{{ partialCached "bench1" . }}`)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
b.Fatalf("unable to create new html template: %s", err)
|
b.Fatalf("unable to create new html template: %s", err)
|
||||||
|
|
Loading…
Reference in a new issue