You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add direct-return fast path for single-candidate rules
On the MySQL grammar, 1,290 of 1,916 rules have a selector where every
(rule, token) entry points to exactly one branch. Those rules account
for ~55% of parse_recursive calls on the test corpus (722k of 1.3M per
10k queries).
Flag those rules at grammar build time. In parse_recursive, detect the
flag and take the only candidate branch directly, skipping the
candidate-iteration loop. On match failure, restore $position and
return false directly instead of going through the multi-candidate
branch_matches/break sequence.
End-to-end parser benchmark:
no JIT: ~31.6K -> ~32.6K QPS avg (+3%)
tracing JIT: ~52.6K -> ~55.7K QPS avg (+6%)
0 commit comments