rust/library/core/src/char
bors bdde2a80ae Auto merge of #121138 - Swatinem:grapheme-extend-ascii, r=cuviper
Add ASCII fast-path for `char::is_grapheme_extended`

I discovered that `impl Debug for str` is quite slow because it ends up doing a `unicode_data::grapheme_extend::lookup` for each char, which ends up doing a binary search.

This introduces a fast-path for ASCII chars which do not have this property.

The `lookup` is thus completely gone from profiles.

---

As a followup, maybe it’s worth implementing this fast path directly in `unicode_data` so that it can check for the lower bound directly before going to a potentially expensive binary search.
2024-03-05 10:28:55 +00:00
..
convert.rs Rewrite assert_unsafe_precondition around the new intrinsic 2024-02-08 11:52:14 -05:00
decode.rs Substitute version placeholders 2023-11-15 19:40:51 -05:00
methods.rs Add ASCII fast-path for char::is_grapheme_extended 2024-02-15 12:00:34 +01:00
mod.rs Use generic NonZero internally. 2024-02-15 08:09:42 +01:00