MCPcopy
hub / github.com/revel/revel / BenchmarkRenderCompressed

Function BenchmarkRenderCompressed

compress_test.go:29–44  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

27}
28
29func BenchmarkRenderCompressed(b *testing.B) {
30 startFakeBookingApp()
31 resp := httptest.NewRecorder()
32 resp.Body = nil
33 c := NewTestController(resp, showRequest)
34 if err := c.SetAction("Hotels", "Show"); err != nil {
35 b.Errorf("SetAction failed: %s", err)
36 }
37 Config.SetOption("results.compressed", "true")
38 b.ResetTimer()
39
40 hotels := Hotels{c}
41 for i := 0; i < b.N; i++ {
42 hotels.Show(3).Apply(c.Request, c.Response)
43 }
44}
45
46func BenchmarkRenderUnCompressed(b *testing.B) {
47 startFakeBookingApp()

Callers

nothing calls this directly

Calls 6

ShowMethod · 0.95
startFakeBookingAppFunction · 0.85
NewTestControllerFunction · 0.85
SetActionMethod · 0.80
ErrorfMethod · 0.65
ApplyMethod · 0.65

Tested by

no test coverage detected