You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Hudson (Jira)" <ji...@apache.org> on 2025/05/01 09:47:00 UTC

[jira] [Commented] (HBASE-29252) Reduce allocations in RowIndexSeekerV1

    [ https://issues.apache.org/jira/browse/HBASE-29252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17948640#comment-17948640 ] 

Hudson commented on HBASE-29252:
--------------------------------

Results for branch branch-2.6
	[build #309 on builds.a.o|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.6/309/]: (x) *{color:red}-1 overall{color}*
----
details (if available):

(/) {color:green}+1 general checks{color}
-- For more information [see general report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.6/309/General_20Nightly_20Build_20Report/]


(/) {color:green}+1 jdk8 hadoop2 checks{color}
-- For more information [see jdk8 (hadoop2) report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.6/309/JDK8_20Nightly_20Build_20Report_20_28Hadoop2_29/]


(x) {color:red}-1 jdk8 hadoop3 checks{color}
-- For more information [see jdk8 (hadoop3) report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.6/309/JDK8_20Nightly_20Build_20Report_20_28Hadoop3_29/]


(/) {color:green}+1 jdk11 hadoop3 checks{color}
-- For more information [see jdk11 report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.6/309/JDK11_20Nightly_20Build_20Report_20_28Hadoop3_29/]


(/) {color:green}+1 jdk17 hadoop3 checks{color}
-- For more information [see jdk17 report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.6/309/JDK17_20Nightly_20Build_20Report_20_28Hadoop3_29/]


(/) {color:green}+1 jdk17 hadoop 3.3.5 backward compatibility checks{color}
-- For more information [see jdk17 report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.6/309/JDK17_20Nightly_20Build_20Report_20_28Hadoop3_29/]


(/) {color:green}+1 jdk17 hadoop 3.3.6 backward compatibility checks{color}
-- For more information [see jdk17 report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.6/309/JDK17_20Nightly_20Build_20Report_20_28Hadoop3_29/]


(x) {color:red}-1 jdk17 hadoop 3.4.0 backward compatibility checks{color}
-- For more information [see jdk17 report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.6/309/JDK17_20Nightly_20Build_20Report_20_28Hadoop3_29/]


(x) {color:red}-1 source release artifact{color}
-- Something went wrong with this stage, [check relevant console output|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.6/309//console].


(x) {color:red}-1 client integration test{color}
-- Something went wrong with this stage, [check relevant console output|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.6/309//console].


> Reduce allocations in RowIndexSeekerV1
> --------------------------------------
>
>                 Key: HBASE-29252
>                 URL: https://issues.apache.org/jira/browse/HBASE-29252
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Charles Connell
>            Assignee: Charles Connell
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 2.7.0, 3.0.0-beta-2, 2.6.3, 2.5.12
>
>         Attachments: scenario-alloc-hs26.html
>
>
> I've looked at a lot of allocation profiles of RegionServers doing a read-heavy workload. Some allocations that dominate the chart can be easily avoided.
> The following code in the main decode method
> {code:java}
> currentBuffer.asSubByteBuffer(currentBuffer.position(), current.keyLength, tmpPair);
> ByteBuffer key = tmpPair.getFirst().duplicate();
> key.position(tmpPair.getSecond()).limit(tmpPair.getSecond() + current.keyLength);
> current.keyBuffer = key; {code}
> results in a new ByteBuffer for every cell. The reason to have this duplicate ByteBuffer is to hold the result of {{tmpPair.getSecond()}} as its {{position}} state. But this in just an integer that can be more cheaply stored in a different way. We can introduce a {{current.keyOffset}} variable and do this instead:
> {code:java}
> currentBuffer.asSubByteBuffer(currentBuffer.position(), current.keyLength, tmpPair);
> current.keyBuffer = tmpPair.getFirst();
> current.keyOffset = tmpPair.getSecond();{code}
> and then reference {{current.keyOffset}} where we previously referenced {{{}current.keyBuffer.position(){}}}.
>  
> Additionally, {{RowIndexSeekerV1.SeekerState}} contains a {{ByteBufferKeyOnlyKeyValue}} field that is replaced on every cell read. This object can be reset and re-used instead.
>  
> On the attached profile, allocations of the duplicate {{ByteBuffers}} and {{{}ByteBufferKeyOnlyKeyValue{}}}s collectively account for 35% of allocations profiled. This is probably representative of the behavior of a typical RegionServer doing a heavy amount of scans while using RowIndexV1.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)