adoroszlai opened a new pull request #197: HDDS-2405. int2ByteString 
unnecessary byte array allocation
URL: https://github.com/apache/hadoop-ozone/pull/197
 
 
   ## What changes were proposed in this pull request?
   
   Simplify `int` to `ByteString` conversion.  Avoid allocating ~7x memory 
overhead (vs. the size of the `ByteString` created).
   
   https://issues.apache.org/jira/browse/HDDS-2405
   
   ## How was this patch tested?
   
   Tested memory usage of various methods:
   
   1. previous implementation
   2. using `ByteString.Output` with restricted initial capacity (4 bytes 
instead of default 128)
   3. eliminating `DataOutputStream` by writing directly to `ByteString.Output`
   4. proposed implementation (simple `copyFrom`)
   
   The last one uses the least amount of memory.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to