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

Tsz-wo Sze commented on RATIS-2099:
-----------------------------------

We may use guava cache 
https://github.com/google/guava/blob/f238ae451fd9c0b3d88c2d94b9e89257cb34fff8/guava/src/com/google/common/cache/CacheBuilder.java#L91-L92

> Remove TermIndex.EMPTY_ARRAY
> ----------------------------
>
>                 Key: RATIS-2099
>                 URL: https://issues.apache.org/jira/browse/RATIS-2099
>             Project: Ratis
>          Issue Type: Improvement
>            Reporter: Wei-Chiu Chuang
>            Priority: Trivial
>         Attachments: Screenshot 2024-05-22 at 2.08.39 PM.png
>
>
> VisualVM profiler shows a top heap consumer is "TermIndex$1"
> While it doesn't say what it is exactly, it looks like EMPTY_ARRAY isn't used 
> and can be removed.
> {code}
> public interface TermIndex extends Comparable<TermIndex> {
>   TermIndex[] EMPTY_ARRAY = {};
> {code}



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

Reply via email to