about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-05-26 15:29:01 +0000
committerbors <bors@rust-lang.org>2022-05-26 15:29:01 +0000
commit1851f0802e148bb7fa0bfd7dabcb7397bf371b0b (patch)
tree7e6f122ecd392e2ab7698fe3dab91de707fb27d1 /compiler/rustc_codegen_gcc
parent1ab98933fa75d72e882b86feac1a0be3a5b02cb0 (diff)
parentd0f993070929428f7a484cfce66d5690e709006d (diff)
downloadrust-1851f0802e148bb7fa0bfd7dabcb7397bf371b0b.tar.gz
rust-1851f0802e148bb7fa0bfd7dabcb7397bf371b0b.zip
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](https://github.com/golang/go/blob/19156a54741d4f353c9e8e0860197ca95a6ee6ca/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
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions