hugo/tpl
Bjørn Erik Pedersen 4ef9baf5bd Only invoke a given cached partial once
Note that this is backed by a LRU cache (which we soon shall see more usage of), so if you're a heavy user of cached partials it may be evicted and
refreshed if needed. But in most cases every partial is only invoked once.

This commit also adds a timeout (the global `timeout` config option) to make infinite recursion in partials
easier to reason about.

```
name              old time/op    new time/op    delta
IncludeCached-10    8.92ms ± 0%    8.48ms ± 1%   -4.87%  (p=0.016 n=4+5)

name              old alloc/op   new alloc/op   delta
IncludeCached-10    6.65MB ± 0%    5.17MB ± 0%  -22.32%  (p=0.002 n=6+6)

name              old allocs/op  new allocs/op  delta
IncludeCached-10      117k ± 0%       71k ± 0%  -39.44%  (p=0.002 n=6+6)
```

Closes #4086
Updates #9588
2023-01-25 17:35:23 +01:00
..
cast tpl: Improve godoc 2022-05-06 19:43:22 +02:00
collections tpl: Improve template funcs GoDoc 2022-12-21 15:33:02 +01:00
compare tpl/compare: Sort special float values as string 2023-01-02 17:35:08 +01:00
crypto tpl: Improve template funcs GoDoc 2022-12-21 15:33:02 +01:00
data tpl: Improve template funcs GoDoc 2022-12-21 15:33:02 +01:00
debug tpl: Improve template funcs GoDoc 2022-12-21 15:33:02 +01:00
diagrams Misc doc, code refactoring to improve documentation 2023-01-04 18:01:26 +01:00
encoding tpl: Improve template funcs GoDoc 2022-12-21 15:33:02 +01:00
fmt tpl: Improve template funcs GoDoc 2022-12-21 15:33:02 +01:00
hugo all: gofmt -w -r 'interface{} -> any' . 2022-03-17 22:03:27 +01:00
images Misc doc, code refactoring to improve documentation 2023-01-04 18:01:26 +01:00
inflect tpl: Improve template funcs GoDoc 2022-12-21 15:33:02 +01:00
internal tpl/strings: Add findRESubmatch 2023-01-17 12:14:11 +01:00
js all: gofmt -w -r 'interface{} -> any' . 2022-03-17 22:03:27 +01:00
lang Improve error messages, esp. when the server is running 2022-05-06 19:43:22 +02:00
math tpl: Use consistent delimiter spacing in examples 2022-11-25 09:54:35 +01:00
openapi Misc doc, code refactoring to improve documentation 2023-01-04 18:01:26 +01:00
os Misc doc, code refactoring to improve documentation 2023-01-04 18:01:26 +01:00
partials Only invoke a given cached partial once 2023-01-25 17:35:23 +01:00
path Misc doc, code refactoring to improve documentation 2023-01-04 18:01:26 +01:00
reflect all: gofmt -w -r 'interface{} -> any' . 2022-03-17 22:03:27 +01:00
resources Misc doc, code refactoring to improve documentation 2023-01-04 18:01:26 +01:00
safe tpl: Improve godoc 2022-05-06 19:43:22 +02:00
site all: gofmt -w -r 'interface{} -> any' . 2022-03-17 22:03:27 +01:00
strings tpl/strings: Add findRESubmatch 2023-01-17 12:14:11 +01:00
templates all: gofmt -w -r 'interface{} -> any' . 2022-03-17 22:03:27 +01:00
time Use configured timeZone for the clock 2022-05-08 16:56:26 +02:00
tplimpl Revert "tpl/tplimpl: Use https in sitemap templates" 2022-12-22 08:53:58 +01:00
transform tpl: Use consistent delimiter spacing in examples 2022-11-25 09:54:35 +01:00
urls Improve error messages, esp. when the server is running 2022-05-06 19:43:22 +02:00
template.go Misc doc, code refactoring to improve documentation 2023-01-04 18:01:26 +01:00
template_info.go Add --printUnusedTemplates 2022-02-15 20:01:57 +01:00
template_test.go Fix Plainify edge cases 2022-05-25 17:55:23 +02:00