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

Maxwell Guo commented on CASSANDRA-19986:
-----------------------------------------

Any  test data or jstack information about the performance improvements before 
and after the change, and the fact that this change has no impact on other 
scenarios. 

> Prepared statements cache computation improvements
> --------------------------------------------------
>
>                 Key: CASSANDRA-19986
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19986
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Legacy/CQL
>            Reporter: Berenguer Blasi
>            Assignee: Berenguer Blasi
>            Priority: Normal
>             Fix For: 4.0.x, 4.1.x, 5.0.x, 5.1
>
>
> Currently prepared statements size are computed twice which is duplicate 
> effort:
>  - 
> [https://github.com/apache/cassandra/blob/cassandra-4.0/src/java/org/apache/cassandra/cql3/QueryProcessor.java#L672]
>  - 
> [https://github.com/apache/cassandra/blob/cassandra-4.0/src/java/org/apache/cassandra/cql3/QueryProcessor.java#L802]
> But we also get the side effect of that 'slow' computation locking the 
> underlying ConcurrentHashMap. We've had nodes becoming unresponsively slow 
> for hours with hundreds of threads in jstack all queued up behind 
> {{computeIfAbsent}} operations on cache insertion/eviction collisions.
> Computing size only once and pulling that value instead of recomputing it on 
> cache insertion was the solution



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

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to