Ivan Andika created RATIS-1890:
----------------------------------

             Summary: SegmentedRaftLogCache#shouldEvict should only iterate 
over closed segments once
                 Key: RATIS-1890
                 URL: https://issues.apache.org/jira/browse/RATIS-1890
             Project: Ratis
          Issue Type: Improvement
    Affects Versions: 2.5.1, 2.5.0, 2.4.1, 2.4.0
            Reporter: Ivan Andika
             Fix For: 2.5.2
         Attachments: image-2023-09-18-13-17-25-569.png, 
profile_cpu_high_rpc_0915_ck_om3.html

It's observed that `SegmentedLogCache#shouldEvict` iterate over the 
`closedSegments` twice:
 * `LogSegmentList#countCached`
 * `LogSegmentList#getTotalCacheSize`

!image-2023-09-18-13-17-25-569.png|width=302,height=198!

We can improve this by iterating over the `closedSegments` once.



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

Reply via email to