akpatnam25 commented on PR #3689:
URL: https://github.com/apache/celeborn/pull/3689#issuecomment-4859879950

   > > use `ThreadLocal<SparkCryptoHandler>` so each push thread holds its own 
instance, and cache a reusable `ByteArrayOutputStream`
   > 
   > @akpatnam25, please take a look at this suggestion. Thanks.
   
   @SteNicholas  I think we don't need `ThreadLocal<SparkCryptoHandler>`. 
`SparkCryptoHandler` only holds `sparkConf` and a key. It has not mutable state 
that would benefit from the thread isolation. 
   
   Let us use the ThreadLocal<ByteArrayOutputStream> inside the existing single 
shared SparkCryptoHandler. This achieves the same memory benefit (reusable 
ByteArrayOutputStream buffer per thread) without changing how the handler is 
stored/accessed in ShuffleClientImpl.


-- 
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]

Reply via email to