go test -v ./... -run=^$ -bench=Benchmark_Router_Handler_Unescape -benchmem -count=4
(b *testing.B)
| 1849 | |
| 1850 | // go test -v ./... -run=^$ -bench=Benchmark_Router_Handler_Unescape -benchmem -count=4 |
| 1851 | func Benchmark_Router_Handler_Unescape(b *testing.B) { |
| 1852 | app := New() |
| 1853 | app.config.UnescapePath = true |
| 1854 | registerDummyRoutes(app) |
| 1855 | app.Delete("/créer", func(_ Ctx) error { |
| 1856 | return nil |
| 1857 | }) |
| 1858 | |
| 1859 | appHandler := app.Handler() |
| 1860 | |
| 1861 | c := &fasthttp.RequestCtx{} |
| 1862 | |
| 1863 | c.Request.Header.SetMethod(MethodDelete) |
| 1864 | c.URI().SetPath("/cr%C3%A9er") |
| 1865 | |
| 1866 | for b.Loop() { |
| 1867 | c.URI().SetPath("/cr%C3%A9er") |
| 1868 | appHandler(c) |
| 1869 | } |
| 1870 | } |
| 1871 | |
| 1872 | // go test -run=^$ -bench=Benchmark_Router_Handler_StrictRouting -benchmem -count=4 |
| 1873 | func Benchmark_Router_Handler_StrictRouting(b *testing.B) { |