Skip to content

Commit

Permalink
Revert "Update the URL rewriter benchmark to reuse configuration (mor…
Browse files Browse the repository at this point in the history
…e realistic)"

This reverts commit a091f01.
  • Loading branch information
joshblakeley committed May 21, 2018
1 parent b6df83c commit 2a8c8fa
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions mw_url_rewrite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,16 @@ func TestRewriter(t *testing.T) {
})
}
}

func BenchmarkRewriter(b *testing.B) {
b.ReportAllocs()
for _, tc := range testRewriterData {
testConf := apidef.URLRewriteMeta{
MatchPattern: tc.pattern,
RewriteTo: tc.to,
}
for i := 0; i < b.N; i++ {

for i := 0; i < b.N; i++ {
for _, tc := range testRewriterData {
testConf := apidef.URLRewriteMeta{
MatchPattern: tc.pattern,
RewriteTo: tc.to,
}
r := httptest.NewRequest("GET", tc.in, nil)
urlRewrite(&testConf, r)
}
Expand Down

0 comments on commit 2a8c8fa

Please sign in to comment.