Skip to content

Commit 29e5cbb

Browse files
committedJun 12, 2023
Adjust benchmark
1 parent ded6866 commit 29e5cbb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed
 

‎helpers/url_test.go

+10-3
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,14 @@ func BenchmarkAbsURL(b *testing.B) {
282282
v.Set("baseURL", "http://base/")
283283
p := newTestPathSpecFromCfgAndLang(v, "")
284284
b.ResetTimer()
285-
for i := 0; i < b.N; i++ {
286-
_ = p.AbsURL("foo/bar", false)
287-
}
285+
b.Run("relurl", func(b *testing.B) {
286+
for i := 0; i < b.N; i++ {
287+
_ = p.AbsURL("foo/bar", false)
288+
}
289+
})
290+
b.Run("absurl", func(b *testing.B) {
291+
for i := 0; i < b.N; i++ {
292+
_ = p.AbsURL("https://base/foo/bar", false)
293+
}
294+
})
288295
}

0 commit comments

Comments
 (0)
Please sign in to comment.