23 lines
394 B
Go
23 lines
394 B
Go
package main_test
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/julienschmidt/httprouter"
|
|
)
|
|
|
|
func BenchmarkJSHR(b *testing.B) {
|
|
bench(
|
|
b,
|
|
func() *httprouter.Router {
|
|
return httprouter.New()
|
|
},
|
|
func(r *httprouter.Router, method string, path string) {
|
|
r.Handle(method, path, func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
|
|
w.Write(payload)
|
|
})
|
|
},
|
|
)
|
|
}
|