[ 
https://issues.apache.org/jira/browse/RATIS-2405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tsz-wo Sze updated RATIS-2405:
------------------------------
    Component/s: gRPC
     Issue Type: Improvement  (was: Bug)

> Remove duplicate computeIfAbsent call in MessageMetrics.inc() method
> --------------------------------------------------------------------
>
>                 Key: RATIS-2405
>                 URL: https://issues.apache.org/jira/browse/RATIS-2405
>             Project: Ratis
>          Issue Type: Improvement
>          Components: gRPC
>            Reporter: Shilun Fan
>            Assignee: Shilun Fan
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> h3. Problem
> The {{MessageMetrics.inc()}} method contains duplicate code that calls twice 
> for the same key, along with an unnecessary synchronized block.
> This leads to: {{computeIfAbsent}}
>  # Redundant map lookups
>  # Code duplication and poor readability
>  # Potential performance overhead



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

Reply via email to