Files
oh-my-pi/crates/pi-natives
can1357 54b1b0728e perf(pi-natives): optimized grapheme width calculation with inline ASCII fast path
- Optimized grapheme width calculation with inline ASCII fast path detection.
- Renamed for_each_grapheme_u16 to for_each_grapheme_u16_slow to clarify it handles non-ASCII segments only.
- Removed segment_is_ascii_u16 helper function and inlined ASCII detection directly in hot loops.
- Refactored visible_width_u16_up_to, truncate_to_width, slice_with_width_impl, and extract_segments_impl to branch on ASCII vs non-ASCII segments separately.
- Improved grapheme_width_str to use pattern matching for single-character detection.
- Changed ANSI sequence tracking from saw_any_ansi to saw_sgr for more precise SGR code detection.
2026-02-01 11:17:36 +01:00
..