go test -v ./... -run=^$ -bench=Benchmark_Router_Handler -benchmem -count=4
(b *testing.B)
| 1551 | |
| 1552 | // go test -v ./... -run=^$ -bench=Benchmark_Router_Handler -benchmem -count=4 |
| 1553 | func Benchmark_Router_Handler(b *testing.B) { |
| 1554 | app := New() |
| 1555 | registerDummyRoutes(app) |
| 1556 | appHandler := app.Handler() |
| 1557 | |
| 1558 | c := &fasthttp.RequestCtx{} |
| 1559 | |
| 1560 | c.Request.Header.SetMethod("DELETE") |
| 1561 | c.URI().SetPath("/user/keys/1337") |
| 1562 | |
| 1563 | for b.Loop() { |
| 1564 | appHandler(c) |
| 1565 | } |
| 1566 | } |
| 1567 | |
| 1568 | func Benchmark_Router_Handler_Strict_Case(b *testing.B) { |
| 1569 | app := New(Config{ |