hugolib: Avoid recloning of shortcode templates
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 23 Apr 2019 10:33:51 +0000 (12:33 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 24 Apr 2019 10:37:57 +0000 (12:37 +0200)
commit69a56420aec5bf5abb846701d4a5ec67fe060d96
tree8b411312f114c3757d699b92250870f313b21989
parent4756ec3cd8ef998f889619fe11be70cc900e2b75
hugolib: Avoid recloning of shortcode templates

```bash
benchmark                                    old ns/op     new ns/op     delta
BenchmarkSiteNew/Bundle_with_image-4         14572242      14382188      -1.30%
BenchmarkSiteNew/Bundle_with_JSON_file-4     13683922      13738196      +0.40%
BenchmarkSiteNew/Multiple_languages-4        41912231      25192494      -39.89%

benchmark                                    old allocs     new allocs     delta
BenchmarkSiteNew/Bundle_with_image-4         57496          57493          -0.01%
BenchmarkSiteNew/Bundle_with_JSON_file-4     57492          57501          +0.02%
BenchmarkSiteNew/Multiple_languages-4        242422         118809         -50.99%

benchmark                                    old bytes     new bytes     delta
BenchmarkSiteNew/Bundle_with_image-4         3845077       3844065       -0.03%
BenchmarkSiteNew/Bundle_with_JSON_file-4     3627442       3627798       +0.01%
BenchmarkSiteNew/Multiple_languages-4        13963502      7543885       -45.97%
```

Fixes #5890
hugolib/site_benchmark_new_test.go [new file with mode: 0644]
hugolib/testhelpers_test.go
tpl/tplimpl/template.go