[jira] [Updated] (CASSANDRA-17202) Avoid unnecessary String.format in QueryProcessor when getting stored prepared statement

2023-05-18 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic updated CASSANDRA-17202:
--
  Fix Version/s: 4.0.10
 4.1.2
 5.0
 3.11.16
 (was: 3.11.x)
 (was: 5.x)
 (was: 4.0.x)
 (was: 4.1.x)
  Since Version: 3.11.0
Source Control Link: 
https://github.com/apache/cassandra/commit/3ca94d65d3fd8f3f010f91e196b37608b08e0828
 Resolution: Fixed
 Status: Resolved  (was: Ready to Commit)

> 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: 4.0.10, 4.1.2, 5.0, 3.11.16
>
>  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: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17202) Avoid unnecessary String.format in QueryProcessor when getting stored prepared statement

2023-05-18 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic updated CASSANDRA-17202:
--
Status: Ready to Commit  (was: Review In Progress)

> 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: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17202) Avoid unnecessary String.format in QueryProcessor when getting stored prepared statement

2023-05-18 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic updated CASSANDRA-17202:
--
Status: Review In Progress  (was: Needs Committer)

> 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: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17202) Avoid unnecessary String.format in QueryProcessor when getting stored prepared statement

2023-05-15 Thread Brandon Williams (Jira)


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

Brandon Williams updated CASSANDRA-17202:
-
Fix Version/s: 3.11.x
   4.0.x
   4.1.x

> 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: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17202) Avoid unnecessary String.format in QueryProcessor when getting stored prepared statement

2023-05-15 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic updated CASSANDRA-17202:
--
Status: Needs Committer  (was: Review In Progress)

> 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: 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: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17202) Avoid unnecessary String.format in QueryProcessor when getting stored prepared statement

2023-05-15 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic updated CASSANDRA-17202:
--
Reviewers: Benjamin Lerer, Brandon Williams, Stefan Miklosovic  (was: 
Benjamin Lerer, Brandon Williams)

> 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: 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: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17202) Avoid unnecessary String.format in QueryProcessor when getting stored prepared statement

2021-12-14 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer updated CASSANDRA-17202:
---
Status: Review In Progress  (was: Needs Committer)

> 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: 4.x
>
>  Time Spent: 10m
>  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.1#820001)

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



[jira] [Updated] (CASSANDRA-17202) Avoid unnecessary String.format in QueryProcessor when getting stored prepared statement

2021-12-13 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer updated CASSANDRA-17202:
---
Reviewers: Benjamin Lerer, Brandon Williams  (was: Brandon Williams)

> 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: 4.x
>
>  Time Spent: 10m
>  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.1#820001)

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



[jira] [Updated] (CASSANDRA-17202) Avoid unnecessary String.format in QueryProcessor when getting stored prepared statement

2021-12-13 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer updated CASSANDRA-17202:
---
  Workflow: Copy of Cassandra Bug Workflow  (was: Copy of Cassandra Default 
Workflow)
Issue Type: Bug  (was: Improvement)

> 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: 4.x
>
>  Time Spent: 10m
>  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.1#820001)

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



[jira] [Updated] (CASSANDRA-17202) Avoid unnecessary String.format in QueryProcessor when getting stored prepared statement

2021-12-10 Thread Brandon Williams (Jira)


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

Brandon Williams updated CASSANDRA-17202:
-
Reviewers: Brandon Williams

> 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: Improvement
>  Components: Messaging/Client
>Reporter: Ivan Senic
>Assignee: Ivan Senic
>Priority: Low
> Fix For: 4.x
>
>  Time Spent: 10m
>  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.1#820001)

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



[jira] [Updated] (CASSANDRA-17202) Avoid unnecessary String.format in QueryProcessor when getting stored prepared statement

2021-12-10 Thread Brandon Williams (Jira)


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

Brandon Williams updated CASSANDRA-17202:
-
Status: Needs Committer  (was: Patch Available)

> 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: Improvement
>  Components: Messaging/Client
>Reporter: Ivan Senic
>Assignee: Ivan Senic
>Priority: Low
> Fix For: 4.x
>
>  Time Spent: 10m
>  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.1#820001)

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



[jira] [Updated] (CASSANDRA-17202) Avoid unnecessary String.format in QueryProcessor when getting stored prepared statement

2021-12-10 Thread Ivan Senic (Jira)


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

Ivan Senic updated CASSANDRA-17202:
---
Description: 
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.

 

  was:
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 in my nerves as it's popping up on my flame graphs all the time.

 


> 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: Improvement
>  Components: Messaging/Client
>Reporter: Ivan Senic
>Assignee: Ivan Senic
>Priority: Low
> Fix For: 4.x
>
>  Time Spent: 10m
>  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.1#820001)

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



[jira] [Updated] (CASSANDRA-17202) Avoid unnecessary String.format in QueryProcessor when getting stored prepared statement

2021-12-10 Thread Ekaterina Dimitrova (Jira)


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

Ekaterina Dimitrova updated CASSANDRA-17202:

Test and Documentation Plan: [https://github.com/apache/cassandra/pull/1358]
 Status: Patch Available  (was: In Progress)

> 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: Improvement
>  Components: Messaging/Client
>Reporter: Ivan Senic
>Assignee: Ivan Senic
>Priority: Low
> Fix For: 4.x
>
>  Time Spent: 10m
>  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 in my nerves as it's popping up on my flame graphs all the time.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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



[jira] [Updated] (CASSANDRA-17202) Avoid unnecessary String.format in QueryProcessor when getting stored prepared statement

2021-12-10 Thread Brandon Williams (Jira)


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

Brandon Williams updated CASSANDRA-17202:
-
Change Category: Performance
 Complexity: Low Hanging Fruit
Component/s: Messaging/Client
  Fix Version/s: 4.x
   Priority: Low  (was: Normal)
 Status: Open  (was: Triage Needed)

> 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: Improvement
>  Components: Messaging/Client
>Reporter: Ivan Senic
>Assignee: Ivan Senic
>Priority: Low
> Fix For: 4.x
>
>  Time Spent: 10m
>  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 in my nerves as it's popping up on my flame graphs all the time.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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