-
Notifications
You must be signed in to change notification settings - Fork 664
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
Several performance optimizations #1822
Several performance optimizations #1822
Conversation
- Add pattern cache when using like (building RegEx is expensive) - Optimize when having lots of values in a (NOT) IN statement, using JS Set - Remove RegEx checking for DATE function - When using NOW, just return the date (not sure why a date is translated to a string and then to a date again)
- Add AST cache
- Adjust or skip unit tests
- Remove cache property
I love it! Let me have a look at the code and merge as soon as possible |
I was under the impression that the failing unit tests where due to running on Windows (newlines), but apparantly these also fail in CI. Are these new failures? Then we need to look into these. |
- Fix LIKE unit tests by not using toUpperCase() anymore; use same code as before, but now with a patternCache
@mathiasrw I fixed the unit tests for the LIKE, all unit tests succeed now locally:
|
- Always use SET, remove old code
- Made returning Date objects configurable as option, to remain backwards compatible - Added unit test for Date objects in relevant test cases
@mathiasrw I adjusted the skipped tests and re-enabled them again, as i made it configurable as option instead. Can you run the workflow again? |
I sure can. Sorry for slow response. Lots of things going on at the moment. I love the performance optimizations, but we cant "just" redo tests that beforehand was working. If we will be doing changes that by some can be considered breaking (= tests are not verifying the same thing as before) than I want to pool those together and add them at the next major version bump (we got a few other tings that is also in the queue for that) Are you OK to split this PR into so we seperate what demands a change of an existing test? |
- Fix using new String in IN statement - Add new test cases for using plain string literals in both IN and NOT IN
@mathiasrw I fixed the implementation so it supports both string literals and new String. Can you check and run the workflow again? This way, we don't need to split of the PR. |
Thanks for merging the PR, will this be part of next release? |
We have been using AlaSQL for a couple of years, and had some patches applied to it locally.
These patches were created after Node.js CPU profiling AlaSQL queries. This PR contains these patches.
Performance improvements for AlaSQL
Please let me know if these changes make sense and/or require changes.
Especially the last two changes might be there for a reason we don't know about.
I also skipped some test cases around string dates and adjusted one for
WHERE IN
, using plain string literals.The PR is lacking new test cases, but if you're interested in these changes, we can work on these.
I couldn't get the formatter to work on Windows though, so that still has to be done.
Thank you for the time you are putting into AlaSQL!