[
https://issues.apache.org/jira/browse/CASSANDRA-17202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17723838#comment-17723838
]
Stefan Miklosovic edited comment on CASSANDRA-17202 at 5/18/23 8:14 AM:
------------------------------------------------------------------------
I ve added the builds and PRs, [~brandon.williams]. Tell me if you need
something else.
4.0 PR https://github.com/apache/cassandra/pull/2340
4.0 j8
https://app.circleci.com/pipelines/github/instaclustr/cassandra/2232/workflows/49dbba70-2110-4039-ab8c-b6ad69a8f71e
4.0 j11
https://app.circleci.com/pipelines/github/instaclustr/cassandra/2232/workflows/7d752769-ee9f-4859-b960-f3eaf4adfeb5
4.1 PR https://github.com/apache/cassandra/pull/2341
4.1 j8
https://app.circleci.com/pipelines/github/instaclustr/cassandra/2231/workflows/c76bcc8e-a416-4edb-bd47-1689666e893f
4.1 j11
https://app.circleci.com/pipelines/github/instaclustr/cassandra/2231/workflows/b0b21d1e-c9dc-4174-be37-09e6dee9dddc
was (Author: smiklosovic):
4.0 PR https://github.com/apache/cassandra/pull/2340
4.0 j8
https://app.circleci.com/pipelines/github/instaclustr/cassandra/2232/workflows/49dbba70-2110-4039-ab8c-b6ad69a8f71e
4.0 j11
https://app.circleci.com/pipelines/github/instaclustr/cassandra/2232/workflows/7d752769-ee9f-4859-b960-f3eaf4adfeb5
4.1 PR https://github.com/apache/cassandra/pull/2341
4.1 j8
https://app.circleci.com/pipelines/github/instaclustr/cassandra/2231/workflows/c76bcc8e-a416-4edb-bd47-1689666e893f
4.1 j11
https://app.circleci.com/pipelines/github/instaclustr/cassandra/2231/workflows/b0b21d1e-c9dc-4174-be37-09e6dee9dddc
> Avoid unnecessary String.format in QueryProcessor when getting stored
> prepared statement
> -----------------------------------------------------------------------------------------
>
> Key: CASSANDRA-17202
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17202
> Project: Cassandra
> Issue Type: Bug
> Components: Messaging/Client
> Reporter: Ivan Senic
> Assignee: Ivan Senic
> Priority: Low
> Fix For: 3.11.x, 4.0.x, 4.1.x, 5.x
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> In the _QueryProcessor#getStoredPreparedStatement_ if the statement is found
> in the prepared statements cache, there is always unnecessary string creation
> using String.format in order to execute the _checkTrue_ assertion. The string
> construction is necessary only when the queries are not equal.
> {code:java}
> public static ResultMessage.Prepared getStoredPreparedStatement(String
> queryString, String clientKeyspace)
> throws InvalidRequestException
> {
> MD5Digest statementId = computeId(queryString, clientKeyspace);
> Prepared existing = preparedStatements.getIfPresent(statementId);
> if (existing == null)
> return null;
> checkTrue(queryString.equals(existing.rawCQLStatement),
> String.format("MD5 hash collision: query with the same MD5 hash
> was already prepared. \n Existing: '%s'", existing.rawCQLStatement));
> {code}
> Hopefully the JIT can optimize this once the _checkTrue_ is inlined, but it's
> getting on my nerves as it's popping up on my flame graphs all the time.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]