go test -v ./... -run=^$ -bench=Benchmark_Router_WithCompression -benchmem -count=4
(b *testing.B)
| 1604 | |
| 1605 | // go test -v ./... -run=^$ -bench=Benchmark_Router_WithCompression -benchmem -count=4 |
| 1606 | func Benchmark_Router_WithCompression(b *testing.B) { |
| 1607 | app := New() |
| 1608 | handler := func(c Ctx) error { |
| 1609 | return c.Next() |
| 1610 | } |
| 1611 | app.Get("/", handler) |
| 1612 | app.Get("/", handler) |
| 1613 | app.Get("/", handler) |
| 1614 | app.Get("/", handler) |
| 1615 | app.Get("/", handler) |
| 1616 | app.Get("/", handler) |
| 1617 | |
| 1618 | appHandler := app.Handler() |
| 1619 | c := &fasthttp.RequestCtx{} |
| 1620 | |
| 1621 | c.Request.Header.SetMethod(MethodGet) |
| 1622 | c.URI().SetPath("/") |
| 1623 | for b.Loop() { |
| 1624 | appHandler(c) |
| 1625 | } |
| 1626 | } |
| 1627 | |
| 1628 | // go test -run=^$ -bench=Benchmark_Startup_Process -benchmem -count=9 |
| 1629 | func Benchmark_Startup_Process(b *testing.B) { |