git-chenhao commented on issue #24744:
URL: 
https://github.com/apache/shardingsphere/issues/24744#issuecomment-1480968850

   ```
    public static void testParse() {
           String sql = "/* mysql-connector-java-5.1.48 ( Revision: 
29734982609c32d3ab7e5cac2e6acee69ff6b4aa ) */SELECT 
%s,@@session.auto_increment_increment AS auto_increment_increment, 
@@character_set_client AS character_set_client, @@character_set_connection AS 
character_set_connection, @@character_set_results AS character_set_results, 
@@character_set_server AS character_set_server, @@collation_server AS 
collation_server, @@collation_connection AS collation_connection, 
@@init_connect AS init_connect, @@interactive_timeout AS interactive_timeout, 
@@license AS license, @@lower_case_table_names AS lower_case_table_names, 
@@max_allowed_packet AS max_allowed_packet, @@net_buffer_length AS 
net_buffer_length, @@net_write_timeout AS net_write_timeout, 
@@performance_schema AS performance_schema, @@query_cache_size AS 
query_cache_size, @@query_cache_type AS query_cache_type, @@sql_mode AS 
sql_mode, @@system_time_zone AS system_time_zone, @@time_zone AS time_zone, 
@@transaction_isolation AS 
 transaction_isolation, @@wait_timeout AS wait_timeout";
           long start = System.currentTimeMillis();
           ShardingSphereSQLParserEngine parseEngine = new 
ShardingSphereSQLParserEngine(DatabaseTypeRegistry.getTrunkDatabaseTypeName(new 
MySQLDatabaseType()));
           parseEngine.parse(String.format(sql, 10), true);
           System.out.println("parse:" + (System.currentTimeMillis() - start) + 
"ms");
           ExecutorService executorService = Executors.newFixedThreadPool(100);
           for (int i = 0; i < 1000; i++) {
               int finalI = i;
               executorService.submit(() -> {
                   long subStart = System.currentTimeMillis();
                   parseEngine.parse(String.format(sql, finalI % 80), true);
                   System.out.println("parse:" + (System.currentTimeMillis() - 
subStart) + "ms");
               });
           }
       }
   ```
   @TeslaCN 


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to