cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tatu Saloranta (Jira)" <>
Subject [jira] [Created] (CASSANDRA-16901) Optimize heavily-used `String.format()`-with-constant formatter use cases
Date Tue, 31 Aug 2021 00:00:01 GMT
Tatu Saloranta created CASSANDRA-16901:

             Summary: Optimize heavily-used `String.format()`-with-constant formatter use
                 Key: CASSANDRA-16901
             Project: Cassandra
          Issue Type: Improvement
            Reporter: Tatu Saloranta

For background, I did some benchmarking to compare performance of two simple ways to concatenate
2 Strings with a separator (used in f.ex `` for "keyspace:name" concatenation):
 # String.format("%s.%s", keyspace, name);
 # new StringBuilder().append(keyspace).append('.').append(name).toString()

Difference is somewhat significant (for me, factor of 40x), as per:

and so it seems worthwhile replacing at least some of usage from Cassandra. With a quick look
it seems that classes like:
 *,, (in cql3)

could benefit from this. And the second implementation can be packaged as a simple utility
method (concatenateStringsWithChar?) so that code should be as readable as before.

I can provide a patch, or if anyone else wants to have a go, feel free to.




This message was sent by Atlassian Jira

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message