go test -v -run=^$ -bench=Benchmark_Ctx_Render_Engine -benchmem -count=4
(b *testing.B)
| 8084 | |
| 8085 | // go test -v -run=^$ -bench=Benchmark_Ctx_Render_Engine -benchmem -count=4 |
| 8086 | func Benchmark_Ctx_Render_Engine(b *testing.B) { |
| 8087 | engine := &testTemplateEngine{} |
| 8088 | err := engine.Load() |
| 8089 | require.NoError(b, err) |
| 8090 | app := New() |
| 8091 | app.config.Views = engine |
| 8092 | c := app.AcquireCtx(&fasthttp.RequestCtx{}) |
| 8093 | |
| 8094 | b.ReportAllocs() |
| 8095 | for b.Loop() { |
| 8096 | err = c.Render("index.tmpl", Map{ |
| 8097 | "Title": "Hello, World!", |
| 8098 | }) |
| 8099 | } |
| 8100 | require.NoError(b, err) |
| 8101 | require.Equal(b, "<h1>Hello, World!</h1>", string(c.Response().Body())) |
| 8102 | } |
| 8103 | |
| 8104 | // go test -v -run=^$ -bench=Benchmark_Ctx_Get_Location_From_Route -benchmem -count=4 |
| 8105 | func Benchmark_Ctx_Get_Location_From_Route(b *testing.B) { |