Commit 8a40a92
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.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent a9b755a commit 8a40a92
1 file changed
Lines changed: 2 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22403 | 22403 | | |
22404 | 22404 | | |
22405 | 22405 | | |
22406 | | - | |
22407 | | - | |
22408 | | - | |
22409 | | - | |
22410 | | - | |
| 22406 | + | |
22411 | 22407 | | |
22412 | 22408 | | |
22413 | 22409 | | |
| |||
22419 | 22415 | | |
22420 | 22416 | | |
22421 | 22417 | | |
22422 | | - | |
22423 | | - | |
22424 | | - | |
22425 | | - | |
| 22418 | + | |
22426 | 22419 | | |
22427 | 22420 | | |
22428 | 22421 | | |
| |||
0 commit comments