yyy1000 commented on issue #25522: URL: https://github.com/apache/beam/issues/25522#issuecomment-1448313105
I came across a solution to this, but I don't know whether my understanding is accurate. Could u please help me to review it and give some comments and suggestions? Thanks! 1. Create a package named "buffer". This package will contain the implementation of the allocated buffer by sync.Pool. 2. Define a struct named Buffer in the "buffer" package that wraps a []byte slice. 3. Implement a "GetBuffer" function in the "buffer" package that returns a new instance of the Buffer struct from the sync.Pool, and a "PutBuffer" function in the "buffer" package that returns a used Buffer struct back to the sync.Pool. 4. Replace all small []byte or bytes.Buffer uses in go sdk with calls to "GetBuffer" and "PutBuffer". -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
