Avoid reading from Viper for path and URL funcs
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 24 Oct 2016 11:45:30 +0000 (13:45 +0200)
committerGitHub <noreply@github.com>
Mon, 24 Oct 2016 11:45:30 +0000 (13:45 +0200)
commita10b2cd372798c4e4b862f0ec03010d2aea2ff1e
treef768c420aac0008e4d118709e13fda278a7588c5
parentdffd7da07c3fb198acfa6c4664b53132c4cabe55
Avoid reading from Viper for path and URL funcs

The gain, given the "real sites benchmark" below, is obvious:

```
benchmark           old ns/op       new ns/op       delta
BenchmarkHugo-4     14497594101     13084156335     -9.75%

benchmark           old allocs     new allocs     delta
BenchmarkHugo-4     57404335       48282002       -15.89%

benchmark           old bytes       new bytes      delta
BenchmarkHugo-4     9933505624      9721984424     -2.13%
```

Fixes #2495
26 files changed:
helpers/configProvider.go
helpers/language.go
helpers/language_test.go [new file with mode: 0644]
helpers/path.go
helpers/path_test.go
helpers/pathspec.go [new file with mode: 0644]
helpers/pathspec_test.go [new file with mode: 0644]
helpers/url.go
helpers/url_test.go
hugolib/hugo_sites_test.go
hugolib/node.go
hugolib/page.go
hugolib/pageSort_test.go
hugolib/page_permalink_test.go
hugolib/page_test.go
hugolib/pagination.go
hugolib/pagination_test.go
hugolib/permalinks.go
hugolib/permalinks_test.go
hugolib/site.go
hugolib/taxonomy.go
tpl/template.go
tpl/template_funcs.go
tpl/template_funcs_test.go
tpl/template_i18n.go
tpl/template_i18n_test.go