Skip to content
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

Improve String-based query parsing #3309

Closed
christophstrobl opened this issue Jan 10, 2024 · 1 comment
Closed

Improve String-based query parsing #3309

christophstrobl opened this issue Jan 10, 2024 · 1 comment
Assignees
Labels
in: query-parser Everything related to parsing JPQL or SQL type: task A general task

Comments

@christophstrobl
Copy link
Member

christophstrobl commented Jan 10, 2024

The current approach to inspecting queries is invoked multiple times for the potentially same query which causes performance regressions.
There are multiple angles to tackle the regressions which will be done in separate tickets:

@christophstrobl christophstrobl added type: task A general task in: query-parser Everything related to parsing JPQL or SQL labels Jan 10, 2024
@christophstrobl christophstrobl self-assigned this Jan 10, 2024
@mp911de mp911de changed the title Improve String based query parsing. Improve String-based query parsing Jan 11, 2024
christophstrobl added a commit that referenced this issue Jun 25, 2024
Add new module using JMH to benchmark certain aspects of query parsing & rendering.

See: #3309
christophstrobl pushed a commit that referenced this issue Jun 25, 2024
Update placeholders to recent syntax, reduce test fork count.

See: #3309
christophstrobl pushed a commit that referenced this issue Jun 25, 2024
This commit turns existing query transformers into introspectors using eager parsing and detection of query parts.
Query transformation has also been split up into dedicated Count and Sort Query parts.
To reduce duplicate code across the existing parses we introduced a reusable functional configuration.
For better testing support a query assertion has been introduced to query parser tests and we adjusted invalid formatting.

See: #3309
Closes: #3326
christophstrobl pushed a commit that referenced this issue Jun 25, 2024
This commit introduce eager alias and projection detection and aims to cache expensive calls.
It also revises JPQL parsers and enhancers into single-class hierarchy and removes strange parameter verification (as it was wrong anyway).

See: #3309
Closes: #3311
christophstrobl added a commit that referenced this issue Jun 25, 2024
This commit introduces a QueryTokenStream to reduce the number of stream and collect operations to estimate the size before iterating entries.

See: #3309
christophstrobl pushed a commit that referenced this issue Jun 25, 2024
This commit moves EQL and HQL parsers to QueryTokenStream and optimizes composite renderers as well as JSQLParser usage.
We also avoid Single-thread construction on each parse run to avoid thread creation overhead.

See: #3309
christophstrobl added a commit that referenced this issue Jun 25, 2024
Avoid iterating tokens when things had been discovered already and reduce visibility of StringQuery to previous value.

See: #3309
@christophstrobl
Copy link
Member Author

Tasks are done - closing as resolved.

@christophstrobl christophstrobl added this to the 3.4 M1 (2024.1.0) milestone Jun 25, 2024
mp911de added a commit that referenced this issue Jun 26, 2024
Reformat pom, replace http urls with HTTPS.

See #3309
christophstrobl added a commit that referenced this issue Aug 22, 2024
...and remove duplicate properties entry.

See: #3309
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: query-parser Everything related to parsing JPQL or SQL type: task A general task
Projects
None yet
Development

No branches or pull requests

1 participant