about summary refs log tree commit diff
path: root/compiler/rustc_target/src/spec/base/avr_gnu.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-03-05 10:28:55 +0000
committerbors <bors@rust-lang.org>2024-03-05 10:28:55 +0000
commitbdde2a80aef587cdbb8eb2d6e295d5c1d05830d9 (patch)
treedc466492548dbb9388c10423a0b5c80a8d0119a4 /compiler/rustc_target/src/spec/base/avr_gnu.rs
parent41d97c8a5dea2731b0e56fe97cd7cb79e21cff79 (diff)
parent8eaaa6e610d92e2b29ef1cf46a796cc27c96428d (diff)
downloadrust-bdde2a80aef587cdbb8eb2d6e295d5c1d05830d9.tar.gz
rust-bdde2a80aef587cdbb8eb2d6e295d5c1d05830d9.zip
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.
Diffstat (limited to 'compiler/rustc_target/src/spec/base/avr_gnu.rs')
0 files changed, 0 insertions, 0 deletions