You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by GitBox <gi...@apache.org> on 2020/09/29 21:39:08 UTC

[GitHub] [thrift] dcelasun commented on a change in pull request #2246: go: Use sync.Pool for gzip in HTTP transport

dcelasun commented on a change in pull request #2246:
URL: https://github.com/apache/thrift/pull/2246#discussion_r497075738



##########
File path: lib/go/thrift/http_transport.go
##########
@@ -40,14 +41,23 @@ func NewThriftHandlerFunc(processor TProcessor,
 
 // gz transparently compresses the HTTP response if the client supports it.
 func gz(handler http.HandlerFunc) http.HandlerFunc {
+	sp := &sync.Pool{
+		New: func() interface{} {
+			return gzip.NewWriter(nil)
+		}}

Review comment:
       No worries, will change this before merging.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org