rust/library/alloc
bors 1851f0802e Auto merge of #97046 - conradludgate:faster-ascii-case-conv-path, r=thomcc
improve case conversion happy path

Someone shared the source code for [Go's string case conversion](19156a5474/src/strings/strings.go (L558-L616)).

It features a hot path for ascii-only strings (although I assume for reasons specific to go, they've opted for a read safe hot loop).

I've borrowed these ideas and also kept our existing code to provide a fast path + seamless utf-8 correct path fallback.

(Naive) Benchmarks can be found here https://github.com/conradludgate/case-conv

For the cases where non-ascii is found near the start, the performance of this algorithm does fall back to original speeds and has not had any measurable speed loss
2022-05-26 15:29:01 +00:00
..
benches Avoid use of rand::thread_rng in stdlib benchmarks 2022-05-02 00:08:21 -07:00
src Auto merge of #97046 - conradludgate:faster-ascii-case-conv-path, r=thomcc 2022-05-26 15:29:01 +00:00
tests improve case conversion happy path 2022-05-26 13:18:57 +01:00
Cargo.toml Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00