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
perf(parser): cache cur_kind() to eliminate redundant calls in compound checks
Optimization to reduce redundant token kind extraction in hot paths.
**Problem**: Compound checks like `self.at(X) || self.at(Y)` call `cur_kind()` twice, and `self.at(close) || self.has_fatal_error()` calls it twice since `has_fatal_error()` internally calls `cur_kind()`.
**Solution**: Cache `cur_kind()` result before compound checks.
**Critical changes**:
- `parse_delimited_list()`: Hot loop that parses arrays, objects, parameters - reduced from 2-3 `cur_kind()` calls per iteration to 1
- `arrow.rs`, `module.rs`, `types.rs`: Fixed 5 locations with double `at()` calls
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments