rust/library/core
bors dcbd5f5134 Auto merge of #97526 - Nilstrieb:unicode-is-printable-fastpath, r=joshtriplett
Add unicode fast path to `is_printable`

Before, it would enter the full expensive check even for normal ascii characters. Now, it skips the check for the ascii characters in `32..127`. This range was checked manually from the current behavior.

I ran the `tracing` test suite in miri, and it was really slow. I looked at a profile, and miri spent most of the time in `core::char::methods::escape_debug_ext`, where half of that was dominated by `core::unicode::printable::is_printable`. So I optimized it here.

The tracing profile:
![The tracing profile](https://user-images.githubusercontent.com/48135649/170883650-23876e7b-3fd1-4e8b-9001-47672e06d914.svg)
2022-05-31 09:34:00 +00:00
..
benches Add unicode fast path to is_printable 2022-05-31 10:51:35 +02:00
primitive_docs
src Auto merge of #97526 - Nilstrieb:unicode-is-printable-fastpath, r=joshtriplett 2022-05-31 09:34:00 +00:00
tests Use Box::new() instead of box syntax in core tests 2022-05-29 01:44:11 +02:00
Cargo.toml Avoid use of rand::thread_rng in stdlib benchmarks 2022-05-02 00:08:21 -07:00