jbewing opened a new pull request, #5347:
URL: https://github.com/apache/hbase/pull/5347

   ### What
   This PR updates BufferedEncodedSeeker#seekToKeyInBlock (used extensively in 
the reverse scan path) to avoid calling `CellUtil.cloneRow` for off-heap Cell 
seek targets.
   
   For `private` "findCommonPrefix*" methods, I used an invariant that the 
"right" cell is always a `keyOnlyKv` and therefore on-heap.
   
   ### Implementation Notes
   For the `public` "compareCommonPrefix*" methods, I added extra paths to them 
to account for either the left or right cell to be on or off-heap to keep the 
behavior optimized for any external callers. In practice, I believe these 
methods are internal to `BufferedEncodedSeeker` except for a few unit tests so 
I'd be open to reducing the branching to just optimize for the left cell being 
able to be on/off-heap. I'd love some feedback on this approach as it adds a 
fair amount of extra code that isn't strictly necessary for this PR.
   
   I also added a test that is a clone of a current `seekToKeyInBlock` over a 
sample of data with the only variation being that the seek target cell is an 
off-heap cell instead of an on-heap one to give coverage over the new path 
here. Let me know if you'd like to see any more tests. 
   
   ### Testing
   Some (naive and non-JMH) testing has been done of the new code path here. It 
looks to be in the range of about 20-30% faster than the old path for off-heap 
cell seek targets. Obviously, take these numbers with a grain of salt as 
they're not from JMH. 
   
   [HBASE-28012](https://issues.apache.org/jira/browse/HBASE-28012)


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