1
0
mirror of https://github.com/labstack/echo.git synced 2025-11-29 22:48:07 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2016-03-18 08:47:03 -07:00
parent bf239af966
commit 7cf31b3b68
4 changed files with 17 additions and 11 deletions

View File

@@ -575,6 +575,7 @@ func TestRouterAPI(t *testing.T) {
func BenchmarkRouterGitHubAPI(b *testing.B) {
e := New()
r := e.router
b.ReportAllocs()
// Add routes
for _, route := range api {
@@ -584,10 +585,14 @@ func BenchmarkRouterGitHubAPI(b *testing.B) {
}
// Find routes
c := e.pool.Get().(*context)
for i := 0; i < b.N; i++ {
for _, route := range api {
// c := e.pool.Get().(*context)
c := e.GetContext()
r.Find(route.Method, route.Path, c)
// router.Find(r.Method, r.Path, c)
e.PutContext(c)
// e.pool.Put(c)
}
}
}