Skip to content

Improve performance of SqlParser::getNextPlaceholder() method#482

Open
Tigrov wants to merge 3 commits intomasterfrom
improve-sql-parser
Open

Improve performance of SqlParser::getNextPlaceholder() method#482
Tigrov wants to merge 3 commits intomasterfrom
improve-sql-parser

Conversation

@Tigrov
Copy link
Member

@Tigrov Tigrov commented Feb 7, 2026

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues

Related PR

@samdark
Copy link
Member

samdark commented Feb 7, 2026

Any benchmarks?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes PostgreSQL SQL parsing by speeding up how the next placeholder is found, specifically by making identifier skipping more efficient inside SqlParser::getNextPlaceholder().

Changes:

  • Introduced a cached identifier character set (IDENTIFIER_CHARS) for fast scanning.
  • Replaced the per-character match loop in skipIdentifier() with a strspn()-based implementation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Feb 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.68%. Comparing base (da724f8) to head (c77e5f6).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #482      +/-   ##
============================================
- Coverage     96.70%   96.68%   -0.03%     
+ Complexity      408      406       -2     
============================================
  Files            67       67              
  Lines          1214     1206       -8     
============================================
- Hits           1174     1166       -8     
  Misses           40       40              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Tigrov
Copy link
Member Author

Tigrov commented Feb 7, 2026

Any benchmarks?

Yes, tested locally. Almost 2 times faster 🚀

image

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.

2 participants