liuchaoheliang opened a new issue #8686:
URL: https://github.com/apache/shardingsphere/issues/8686
version 5.x
when I was testing and parsing a large sql, use the same engine , new
SQLStatementParserEngine("MySQL"), do 50 times parse. watch the cost time,
i found The first few times are much more time-consuming than the subsequent
analysis. why ?
my java code like this:
@Test
public void test() {
String sql = "select ........";
SQLStatementParserEngine engine = new
SQLStatementParserEngine("MySQL");
int i = 0;
while (i < 50){
Long now = System.currentTimeMillis();
engine.parse(sql, false);
Long cost = System.currentTimeMillis() - now;
System.out.println("cost:" + cost);
i++;
}
}
RESULT:
times: 0,cost(ms):1097
times: 1,cost(ms):11
times: 2,cost(ms):13
times: 3,cost(ms):8
times: 4,cost(ms):9
times: 5,cost(ms):4
times: 6,cost(ms):3
times: 7,cost(ms):3
times: 8,cost(ms):3
times: 9,cost(ms):4
times: 10,cost(ms):9
times: 11,cost(ms):4
times: 12,cost(ms):3
times: 13,cost(ms):2
times: 14,cost(ms):2
times: 15,cost(ms):5
times: 16,cost(ms):3
times: 17,cost(ms):3
times: 18,cost(ms):2
times: 19,cost(ms):1
times: 20,cost(ms):3
.......
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]