Francisco Guerrero created CASSSIDECAR-347:
----------------------------------------------

             Summary: Improve FilteringMetricRegistry implementation
                 Key: CASSSIDECAR-347
                 URL: https://issues.apache.org/jira/browse/CASSSIDECAR-347
             Project: Sidecar for Apache Cassandra
          Issue Type: Improvement
            Reporter: Francisco Guerrero
            Assignee: Francisco Guerrero
         Attachments: PastedGraphic-1.png

While profiling a Sidecar instance under load I noticed that we are spending a 
lot of time recreating a map when calling the 
{{org.apache.cassandra.sidecar.metrics.FilteringMetricRegistry#getMetrics}} 
method. Recomputing this map every time is inefficient and unnecessary. We can 
precompute it when needed and use it until we change it.

The attached graphic shows a snapshot of the profiling session. There are two 
stacktraces where we call {{getMetrics()}} and this accounts for over 50% of 
the CPU time in a 5 minute profiling session. In addition to the overhead, a 
lot of garbage is created.

I propose an optimized implementation of the 
{{org.apache.cassandra.sidecar.metrics.FilteringMetricRegistry#getMetrics}} 
method that should help reduce load in Sidecar.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to