-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[KQL] Fix performance issue with nested subqueries #181208
Conversation
/ci |
1 similar comment
/ci |
c68e70f
to
bc5b485
Compare
/ci |
/ci |
/ci |
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
@@ -16,8 +16,7 @@ import { nodeTypes } from '../node_types'; | |||
import { DataViewBase } from '../../..'; | |||
import { KueryNode } from '../types'; | |||
import { fields } from '../../filters/stubs'; | |||
|
|||
jest.mock('../grammar'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This grammar file was not being updated as part of the build, and it doesn't need to be mocked any longer anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was only used in the test above, and we no longer need it mocked.
}); | ||
expect(resp.body.error).to.be('Bad Request'); | ||
expect(resp.body.statusCode).to.be(400); | ||
expect(resp.body.message).to.match(/KQLSyntaxError[\s\S]+Bad Request/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is "KQL syntax error should return 400 with Bad Request" - With the changes in this PR, the format of the error messages in these tests changed slightly. We don't care about the exact content of the message.
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Page load bundle
Unknown metric groupsESLint disabled in files
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @lukasolson |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look good, works well - nice performance increase!
Summary
Resolves #143335.
Some history: A similar issue was reported a few years back (#76811). The solution (#93319) was to use the
--cache
PEG.js parameter when generating the parser. Back when this was added, we were still manually building the parser on demand when it was changed. Eventually we added support for dynamically building the parser during the build process (#145615). I'm not sure where along the process thecache
parameter got lost but it didn't appear to be used when we switched.This PR re-adds this parameter which increases performance considerably (metrics shown in ops/sec):
Checklist