[ https://issues.apache.org/jira/browse/HBASE-5625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13236731#comment-13236731 ]
Zhihong Yu commented on HBASE-5625: ----------------------------------- I don't see where loadValue() is called. Minor comments: {code} + long longkeylength = KEY_INFRASTRUCTURE_SIZE + rlength + flength + qlength; {code} we normally use variable names such as longKeyLength where the second and subsequent words have leading capital letter. {code} + if(flength != 0) { ... + if(qlength != 0) { {code} Please insert space between if and (. {code} + KeyValue searchTerm = getSearchTerm(kvs[0].getRow(), family, foffset, flength, qualifier, qoffset, qlength); {code} Recent vote is to limit ling length within 100 characters. {code} + if (lLength > Integer.MAX_VALUE) + throw new IllegalArgumentException("KeyValue length " + lLength + " > " + Integer.MAX_VALUE); {code} Please enclose the throw statement in curly braces. {code} + * The KeyValue for the most recent for a given column. If the column does + * not exist in the result set - if it wasn't selected in the query (Get/Scan) + * or just does not exist in the row the return value is null. {code} I think the above can be phrased as: {code} + * The most recent KeyValue for a given column. If the column does + * not exist in the result set - if it wasn't selected in the query (Get/Scan) + * or just does not exist in the row - the return value is null. {code} > Avoid byte buffer allocations when reading a value from a Result object > ----------------------------------------------------------------------- > > Key: HBASE-5625 > URL: https://issues.apache.org/jira/browse/HBASE-5625 > Project: HBase > Issue Type: Improvement > Components: client > Affects Versions: 0.92.1 > Reporter: Tudor Scurtu > Labels: patch > Attachments: 5625.txt, 5625v2.txt > > > When calling Result.getValue(), an extra dummy KeyValue and its associated > underlying byte array are allocated, as well as a persistent buffer that will > contain the returned value. > These can be avoided by reusing a static array for the dummy object and by > passing a ByteBuffer object as a value destination buffer to the read method. > The current functionality is maintained, and we have added a separate method > call stack that employs the described changes. I will provide more details > with the patch. > Running tests with a profiler, the reduction of read time seems to be of up > to 40%. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira