23 lines
373 B
Go
23 lines
373 B
Go
package main_test
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/bmizerany/pat"
|
|
)
|
|
|
|
func BenchmarkPat(b *testing.B) {
|
|
bench(
|
|
b,
|
|
func() *pat.PatternServeMux {
|
|
return pat.New()
|
|
},
|
|
func(m *pat.PatternServeMux, method string, path string) {
|
|
m.Add(method, path, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
w.Write(payload)
|
|
}))
|
|
},
|
|
)
|
|
}
|