bump(github.com/gorilla/mux): b08c5fcf14d01cb0c20ddf70157f54d4a2c3a38a
This commit is contained in:
21
third_party/github.com/gorilla/mux/bench_test.go
vendored
Normal file
21
third_party/github.com/gorilla/mux/bench_test.go
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2012 The Gorilla Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package mux
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkMux(b *testing.B) {
|
||||
router := new(Router)
|
||||
handler := func(w http.ResponseWriter, r *http.Request) {}
|
||||
router.HandleFunc("/v1/{v1}", handler)
|
||||
|
||||
request, _ := http.NewRequest("GET", "/v1/anything", nil)
|
||||
for i := 0; i < b.N; i++ {
|
||||
router.ServeHTTP(nil, request)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user