Repository navigation
Commit 1db8572
committed
perf: skip redundant lookahead simulations in Condition dispatch and expression lists
The main branch of Condition/SQLCondition is the last alternative of its
choice: entering it and letting the productions reject is equivalent to the
deep jj_2 phase simulation that ran for every plain condition first, so gate
it with a cheap !interrupted check instead. The named-parameter alternatives
of ComplexExpressionList only ever match a single-token name directly
followed by their assignment token, so a first check on the second token is
equivalent to their 2-token lookahead scan.
parseSQLStatements: 21.3-21.4 vs 24.6-24.8 ms/op against master in 3
interleaved JMH pairs (-13% to -14%, error intervals not overlapping);
behavior verified identical by 26 EXISTS/named-parameter probes, the full
10,344-test suite (same 35 pre-existing environment failures as master) and
a byte-identical AST dump of performance.sql.
Signed-off-by: 付典 <fudianchn@gmail.com>1 parent bdf8ac3 commit 1db8572
1 file changed
Lines changed: 23 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1265 | 1265 | | |
1266 | 1266 | | |
1267 | 1267 | | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
1268 | 1279 | | |
1269 | 1280 | | |
1270 | 1281 | | |
| |||
11048 | 11059 | | |
11049 | 11060 | | |
11050 | 11061 | | |
| 11062 | + | |
| 11063 | + | |
| 11064 | + | |
| 11065 | + | |
11051 | 11066 | | |
11052 | 11067 | | |
11053 | 11068 | | |
| |||
11198 | 11213 | | |
11199 | 11214 | | |
11200 | 11215 | | |
11201 | | - | |
| 11216 | + | |
| 11217 | + | |
| 11218 | + | |
| 11219 | + | |
11202 | 11220 | | |
11203 | 11221 | | |
11204 | 11222 | | |
| |||
11663 | 11681 | | |
11664 | 11682 | | |
11665 | 11683 | | |
11666 | | - | |
| 11684 | + | |
11667 | 11685 | | |
11668 | | - | |
| 11686 | + | |
11669 | 11687 | | |
11670 | 11688 | | |
11671 | 11689 | | |
| |||
11676 | 11694 | | |
11677 | 11695 | | |
11678 | 11696 | | |
11679 | | - | |
| 11697 | + | |
11680 | 11698 | | |
11681 | | - | |
| 11699 | + | |
11682 | 11700 | | |
11683 | 11701 | | |
11684 | 11702 | | |
| |||
0 commit comments