You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2019/11/15 22:30:17 UTC

[GitHub] [hadoop-ozone] adoroszlai opened a new pull request #197: HDDS-2405. int2ByteString unnecessary byte array allocation

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org