about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm_util.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-05-31 09:34:00 +0000
committerbors <bors@rust-lang.org>2022-05-31 09:34:00 +0000
commitdcbd5f5134e396353207f1f79e50794b83cee7d2 (patch)
treead8a495092c69694241f4b3de984d52ad0eb79bf /compiler/rustc_codegen_llvm/src/llvm_util.rs
parentd35d972e6974d40d30362344ea619a5b560aae20 (diff)
parent3358a41acbcb82daf3cd71197b2a053152a9a376 (diff)
downloadrust-dcbd5f5134e396353207f1f79e50794b83cee7d2.tar.gz
rust-dcbd5f5134e396353207f1f79e50794b83cee7d2.zip
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)
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
0 files changed, 0 insertions, 0 deletions