Title: perf: bound single-token lookahead probes by fudianchn · Pull Request #2829 · JSQLParser/JSqlParser · GitHub
Open Graph Title: perf: bound single-token lookahead probes by fudianchn · Pull Request #2829 · JSQLParser/JSqlParser
X Title: perf: bound single-token lookahead probes by fudianchn · Pull Request #2829 · JSQLParser/JSqlParser
Description: AI disclosure: this change was prepared with AI coding agents. This revision is awaiting my line-by-line review. What Bound 57 complete single-token syntactic probes to depth one and remove the redundant depth-three guard in DBMSDestination. Keep the parser regression tests. Remove the in-repository audit tooling, its build task, CI integration and documentation, as requested. Why Complete one-token probes need only one token of lookahead. The DBMSDestination alternatives start with distinct TABLE and STATEMENT tokens, so their existing dispatch does not need a three-token probe. How Keep each explicit token restriction as LOOKAHEAD(1, ...); deleting it could widen the decision to the following production. Preserve semantic predicates and multi-token probes. Merge current master while retaining its newer grammar changes. Reusable audit tooling is tracked separately in manticore-projects/javacc-8-core#1; this PR adds no JavaCC integration or dependency. Root cause An unbounded syntactic probe generates scan machinery even when its complete restriction is a single token. The DBMS destination guard also probes beyond the token needed to choose its alternative. Testing 29 focused parser cases pass. On current master, only the expected missing-TABLE-name consumption assertion fails; the other 28 pass. Forcing the TABLE branch makes both STATEMENT guards fail. Gradle check: 12,200 tests, zero failures/errors, 25 skipped. Maven clean verify: 12,182 tests, zero failures/errors, 25 skipped. Both parsers produce all 54 corpus statements with identical deparsed output, semantic fields and serialized AST bytes. Project JMH parseSQLStatements, identical corpus and benchmark bytecode, JDK 17.0.20 on an i9-13900KS (32 logical CPUs), interleaved master/candidate twice: each window has 3 forks, 3 three-second warmups and 10 one-second measurements per fork (120 measurement samples overall). Master: 19.447 ± 1.042 and 17.942 ± 0.441 ms/op; candidate: 18.575 ± 1.116 and 18.431 ± 0.712 ms/op (JMH 99.9% confidence intervals). Paired changes are -4.48% and +2.73%; intervals overlap and host load varies. These measurements establish neither a reliable speedup nor a stable slowdown. An initial three-second-total warmup attempt was stopped after observing continued warmup drift and is excluded from these figures. Remote CI and other operating systems were not run locally. Behavior notes EXA AT conn TABLE remains invalid. It now reports the missing table name after consuming TABLE, rather than falling through to the STATEMENT alternative. Exact diagnostic text and location are not preserved. No public AST API is changed.
Open Graph Description: AI disclosure: this change was prepared with AI coding agents. This revision is awaiting my line-by-line review. What Bound 57 complete single-token syntactic probes to depth one and remove the red...
X Description: AI disclosure: this change was prepared with AI coding agents. This revision is awaiting my line-by-line review. What Bound 57 complete single-token syntactic probes to depth one and remove the red...
Opengraph URL: https://github.com/JSQLParser/JSqlParser/pull/2829
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:1a58576b-64ae-7e4e-a7c1-7fdb8e9d1891 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C20C:3488ED:E52E9F:140E91C:6B044309 |
| html-safe-nonce | f055148a5c45d4831c763cdbeb3fb70cc80b0f1db9e29e6ab3effcd8b008d56a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjBDOjM0ODhFRDpFNTJFOUY6MTQwRTkxQzo2QjA0NDMwOSIsInZpc2l0b3JfaWQiOiI3MDIxNzMzNTczMjE2NzE1NTI5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5e4d08f1096d2fa0e82387ef127a006f08b54fe0be4a8a3123ede4f19c8772ad |
| hovercard-subject-tag | pull_request:4884890635 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/JSQLParser/JSqlParser/pull/2829/files |
| twitter:image | https://avatars.githubusercontent.com/u/40510713?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40510713?s=400&v=4 |
| og:image:alt | AI disclosure: this change was prepared with AI coding agents. This revision is awaiting my line-by-line review. What Bound 57 complete single-token syntactic probes to depth one and remove the red... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/JSQLParser/JSqlParser git https://github.com/JSQLParser/JSqlParser.git |
| octolytics-dimension-user_id | 4643847 |
| octolytics-dimension-user_login | JSQLParser |
| octolytics-dimension-repository_id | 1944709 |
| octolytics-dimension-repository_nwo | JSQLParser/JSqlParser |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1944709 |
| octolytics-dimension-repository_network_root_nwo | JSQLParser/JSqlParser |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 06dc448a76fe4751ac1db26524aefa3aa3e889a8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width