rust/library/core
Dylan DPC 4af965e732
Rollup merge of #81837 - gilescope:to_ascii_speedups, r=dtolnay
Slight perf improvement on char::to_ascii_lowercase

`char::to_ascii_lowercase()` was checking if it was ascii and then if it was in the right range. Instead propose to check once (I think removing a compare and a shift in the process: [godbolt](https://godbolt.org/z/e5Tora) ).

before:
```
        test char::methods::bench_to_ascii_lowercase                    ... bench:      11,196 ns/iter (+/- 632)
        test char::methods::bench_to_ascii_uppercase                    ... bench:      11,656 ns/iter (+/- 671)
```
after:
```
         test char::methods::bench_to_ascii_lowercase                    ... bench:       9,612 ns/iter (+/- 979)
         test char::methods::bench_to_ascii_uppercase                    ... bench:       8,241 ns/iter (+/- 701)
```

(calling u8::to_ascii_lowercase and letting that flip the 5th bit is also an option, but it's more instructions. I'm thinking for things around ascii and char we want to be as efficient as possible.)
2021-02-23 02:51:47 +01:00
..
benches Unify way to flip 6th bit. (Same assembly generated) 2021-02-08 12:21:36 +00:00
src Rollup merge of #81837 - gilescope:to_ascii_speedups, r=dtolnay 2021-02-23 02:51:47 +01:00
tests Rollup merge of #82093 - bjorn3:more_atomic_tests, r=kennytm 2021-02-19 02:49:07 +01:00
Cargo.toml