javacc parser is very slow to parse sql
See original GitHub issueI executed a batch insert SQL, but the execution was very slow. I took a look at Flame Graph and the sql parsing took most of the time. I looked at the source code of this project, which uses the parser generated by javacc. Will this have a significant impact on performance? I hope someone can help improve it.
my sql like this:
insert into trade_info (id, ....)
values
(111, ...),
(222, ...),
(333, ...),
...
-- 1000 rows
Issue Analytics
- State:
- Created 2 years ago
- Comments:10
Top Results From Across the Web
Understanding JavaParser compared to JavaCC and Eclipse ...
I'm quite new to parsing and struggling to find info on resources regarding comparisons between the main java parsing options. I understand ...
Read more >Design and Practice of Self-Developed SQL Parser
Many tools, such as ANTLR and JavaCC have been used to generate SQL Parser. However, the values clause will produce too many AST...
Read more >Implementing High Performance Parsers in Java - InfoQ
Random access parser implementations are often slower than sequential access parsers, because they generally build up some kind of object tree ...
Read more >JavaCC | The most popular parser generator for use with Java ...
Why are line and column numbers not recorded? Can I process Unicode? The Parser and Lookahead. Where should I draw the line between...
Read more >CF-3496254 | Tracker
Please parse out /**/ SQL style comments in Query of Queries. ... Rupesh, is the "JavaCC SQL Parser" you mention a third party...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry, I tested it again and found that using the native batch and using httpClient is similar.
For the previous slow of batch insert, the core reason is that the spring framework call connect.getMetaData() while some fields of the inserted data are null. And ClickHouseConnectionImpl.getMetaData() will use LogProxy reflection proxy to record logs.
I think the LogProxy can be optimized. There should be many frameworks that call ClickHouseConnectionImpl.getMetaData(). And reflection logging really affects performance.
Thanks again for the clarification. So to summarize:
Now batch insertion at this point is based on text-based format, so I expect the performance will be improved after switching to binary format. I’ll address the last two in 0.3.1 release, and the first in 0.4.0.