From: Bjørn Erik Pedersen Date: Mon, 12 Jun 2023 13:15:28 +0000 (+0200) Subject: Add BenchmarkAbsURL X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ded6866001d0c6299708b518aacf154176afe972;p=brevno-suite%2Fhugo Add BenchmarkAbsURL --- diff --git a/helpers/url_test.go b/helpers/url_test.go index 6d496ce8e..716719522 100644 --- a/helpers/url_test.go +++ b/helpers/url_test.go @@ -276,3 +276,13 @@ func BenchmarkRelURL(b *testing.B) { _ = p.RelURL("https://base/foo/bar", false) } } + +func BenchmarkAbsURL(b *testing.B) { + v := config.New() + v.Set("baseURL", "http://base/") + p := newTestPathSpecFromCfgAndLang(v, "") + b.ResetTimer() + for i := 0; i < b.N; i++ { + _ = p.AbsURL("foo/bar", false) + } +}