Shugo Maeda 0728ece031 [ruby/prism] Avoid a quadratic walk when parsing long call chains
parse_expression_terminator runs after every infix operator and called
pm_block_call_p, which walks the whole receiver chain, even when the
binding power alone already decided the result. Check the binding power
first; pm_block_call_p is pure, so the condition is unchanged.

Parsing "a" followed by 8000 ".b" links drops from 44.8ms to 0.46ms.

https://github.com/ruby/prism/commit/8a40a928a8

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-28 10:19:02 +00:00
..