sync.Pool for rw

This commit is contained in:
2025-05-09 18:14:24 +02:00
parent fd78380cb4
commit 787ead652d
2 changed files with 51 additions and 11 deletions
+3 -1
View File
@@ -568,11 +568,13 @@ func Test_newLogger(t *testing.T) {
}
}
var preallocatedHello = []byte("Hello")
func Benchmark_GET(b *testing.B) {
engine := New()
engine.GET("/hello", func(c *CTX) {
c.W.Write([]byte("Hello"))
c.W.Write(preallocatedHello)
})
req := httptest.NewRequest(http.MethodGet, "/hello", nil)