You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i'm using minify https://github.com/tdewolff/minify to minify ctx.Response.Body() but trying to reduce GC pressure by doing arena but was wondering if i can just somehow modify the Response Body w/o mem copying... which will be better. is this possible?
mem := arena.NewArena()
o := arena.New[H](mem)
o.Data, o.Err = m.Bytes("text/html", ctx.Response.Body()) //minified here
if o.Err != nil {
log.Printf("minify1 %s", o.Err)
} else {
log.Printf("o.Data = %s", o.Data)
ctx.Response.SetBody(o.Data)
}
ctx.Response.Header.SetStatusCode(200)
ctx.Response.Header.SetContentType("text/html")
mem.Free()
The text was updated successfully, but these errors were encountered:
i'm using minify https://github.com/tdewolff/minify to minify ctx.Response.Body() but trying to reduce GC pressure by doing arena but was wondering if i can just somehow modify the Response Body w/o mem copying... which will be better. is this possible?
The text was updated successfully, but these errors were encountered: