-
Notifications
You must be signed in to change notification settings - Fork 554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EPIC] Improve sqlparser performance #1557
Comments
@alamb How are you generating your flamegraphs? Locally, |
This is basically what I normally do. Sometimes it is tricky to interpret the cargo bench flamegraph as it has both the warmup and the run Can you post the flamegraph you have? |
So this is kinda weird. It appears the Running However, it works fine if I run flamegraph against the binary directly:
And the easier to remember version works as well:
So no idea why that |
🎉 glad to hear you figured out a way past the current issue. I have also found argument handling with |
What problem are you trying to solve?
Normally, in a SQL processing system, parsing SQL is not a major bottleneck compared to actually processing data. That being said, given how many SQL strings are parsed by this crate, I think there is significant benefit to improving the performance of the SQL parser in this crate.
That being said, I also think it is important to minimize the impact on downstream crates as much as possible.
Recently, we started introducing locations into the parser (thanks again @Nyrox!), which we found slows things down a bit (see #1435 (comment)).
Thankfully, I think there is significant room for improvement. As as part of the adding location information, I spent some time profiling and I think there are some obvious ways to improve the performance without impacting downstream crates.
Here is the flamegraph for anyone who is interested (you can download it locally to get zoom / etc):
fixed-flamegraph
What would you like to see?
The idea would be
Ideas to improve performance:
Token
(which involves copying strings)L: Improve performance by not copyingToken
s as much #1558Parser
generic around dialect #1381The text was updated successfully, but these errors were encountered: