bereng commented on code in PR #4092: URL: https://github.com/apache/cassandra/pull/4092#discussion_r2043799574
########## src/java/org/apache/cassandra/cql3/QueryProcessor.java: ########## @@ -472,7 +477,9 @@ public static Prepared parseAndPrepare(String query, ClientState clientState, bo res = new Prepared(statement, "", fullyQualified, keyspace); else res = new Prepared(statement, query, fullyQualified, keyspace); - res.pstmntSize = measurePstmnt(res); + + if (measure) + res.pstmntSize = measurePstmnt(res); Review Comment: I was worried about pstmnts with size 0 exploding the cache but `getSizeOfPreparedStatementForCache()`already guards us against that. I would add a comment though explaining sometimes we don't need to measure as it won't make it into the cache, otherwise it reads a bit strange imo, -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org