ruff
e3304857 - Specialize ASCII identifier lexing (#29503)

Commit
3 days ago
Specialize ASCII identifier lexing (#29503) ## Summary We give ASCII identifiers a dedicated path, avoiding Unicode bookkeeping and checking string prefixes only when a one- or two-letter name reaches a quote. Both paths share the existing batched ASCII scanner, preserving fast scanning for Unicode names with long ASCII suffixes. Stacked on #29463 to measure the incremental improvement. [CodSpeed reports](https://github.com/astral-sh/ruff/pull/29503/checks?check_run_id=118300735426) 6.6–9.8% greater efficiency across all five lexer benchmarks, with no reported regressions. We preserve the existing scanner and add no inlining attributes or unsafe code.
Author
Parents
Loading