[
https://issues.apache.org/jira/browse/HBASE-28488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17834266#comment-17834266
]
Thibault Deutsch commented on HBASE-28488:
------------------------------------------
I would like to upstream the patch that we have, if people are okay with the
change.
I couldn't find any contributing guidelines that explains the process followed
by HBase, so I'm trying to just follow what I have seen done in other Jira
ticket. Let me know if there is anything I need to do!
> Avoid expensive allocation in createRegionSpan
> ----------------------------------------------
>
> Key: HBASE-28488
> URL: https://issues.apache.org/jira/browse/HBASE-28488
> Project: HBase
> Issue Type: Improvement
> Components: tracing
> Affects Versions: 2.5.0
> Environment: Multiple clusters with:
> * OpenJDK 11.0.22+7
> * HBase 2.5.7
> * 10-150 RegionServers
> * 90-95% writes requests
> Reporter: Thibault Deutsch
> Priority: Minor
> Attachments: Screenshot 2024-04-05 at 00.27.11.png
>
>
> On our busy clusters, the alloc profile shows that createRegionSpan() is
> responsible for 15-20% of all the allocations. These allocations comes from
> getRegionNameAsString().
> getRegionNameAsString() takes the region name and encode invisible characters
> in their hex representation. This requires the use of a StringBuilder and
> thus generate new strings every time.
> This becomes really expensive on a cluster with high number of requests. We
> have a patch that replaced the call with getEncodedName() instead. It seems
> better to just take the encoded region name (the md5 part) and use that in
> trace attributes, because:
> - it's fixed in size (the full region name can be much longer depending on
> the rowkey size),
> - it's enough information to link a trace to a region,
> - it doesn't require any new allocation.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)