Skip to content

Fix performance of very nested SQL files, add example to benchmark #217

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

Closed
wants to merge 5 commits into from

Conversation

Dandandan
Copy link
Contributor

@Dandandan Dandandan commented Jun 28, 2020

This adds one of the inputs found during fuzzing as benchmarking input.

#216

According to benchmark,the query takes 75.814 ms on average. That is much more than the other benchmarks, which are more than 1000x as fast (3 / 17 microseconds).

I included a fix which memoizes the unsuccesful usage of parse_derived_table_factor.

This brings down the benchmark to 109.24 microseconds (687 times speedup for this extreme example).

@Dandandan Dandandan marked this pull request as draft June 28, 2020 19:34
@coveralls
Copy link

coveralls commented Jun 28, 2020

Pull Request Test Coverage Report for Build 152428199

  • 6 of 7 (85.71%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 91.768%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser.rs 6 7 85.71%
Totals Coverage Status
Change from base Build 150634388: -0.01%
Covered Lines: 4225
Relevant Lines: 4604

💛 - Coveralls

@Dandandan Dandandan changed the title Add SQL that takes very long to benchmark Add SQL that takes very long to parse to benchmark Jun 28, 2020
@Dandandan Dandandan marked this pull request as ready for review June 30, 2020 07:13
@Dandandan
Copy link
Contributor Author

Dandandan commented Jun 30, 2020

I included a fix which memoizes the unsuccesful usage of parse_derived_table_factor.

This brings down the benchmark to 109.24 microseconds (687 times speedup for this extreme example).

@Dandandan Dandandan changed the title Add SQL that takes very long to parse to benchmark Add/fix SQL that takes very long to parse to benchmark Jun 30, 2020
@Dandandan Dandandan changed the title Add/fix SQL that takes very long to parse to benchmark Add/fix performance of very nested SQL files Jun 30, 2020
@Dandandan Dandandan changed the title Add/fix performance of very nested SQL files Fix performance of very nested SQL files, add example to benchmark Jun 30, 2020
@alamb
Copy link
Contributor

alamb commented Aug 20, 2021

@Dandandan Is this PR still something we should work on to help contribute?

@Dandandan
Copy link
Contributor Author

@Dandandan Is this PR still something we should work on to help contribute?

I think the benchmark is a useful example of some problematic input for the parser.
Not sure whether this PR is a good way to solve it (better would be to rewrite the parser to avoid this)

@alamb
Copy link
Contributor

alamb commented Dec 8, 2021

Closing old PRs. Please feel free to re-open if this was a mistake

@alamb alamb closed this Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants