rust/library
bors 86bd45979a Auto merge of #130223 - LaihoE:faster_str_replace, r=thomcc
optimize str.replace

Adds a fast path for str.replace for the ascii to ascii case. This allows for autovectorizing the code. Also should this instead be done with specialization? This way we could remove one branch. I think it is the kind of branch that is easy to predict though.

Benchmark for the fast path (replace all "a" with "b" in the rust wikipedia article, using criterion) :
| N        | Speedup | Time New (ns) | Time Old (ns) |
|----------|---------|---------------|---------------|
| 2        | 2.03    | 13.567        | 27.576        |
| 8        | 1.73    | 17.478        | 30.259        |
| 11       | 2.46    | 18.296        | 45.055        |
| 16       | 2.71    | 17.181        | 46.526        |
| 37       | 4.43    | 18.526        | 81.997        |
| 64       | 8.54    | 18.670        | 159.470       |
| 200      | 9.82    | 29.634        | 291.010       |
| 2000     | 24.34   | 81.114        | 1974.300      |
| 20000    | 30.61   | 598.520       | 18318.000     |
| 1000000  | 29.31   | 33458.000     | 980540.000    |
2024-10-17 16:20:02 +00:00
..
alloc Auto merge of #130223 - LaihoE:faster_str_replace, r=thomcc 2024-10-17 16:20:02 +00:00
backtrace@230570f2da
core Auto merge of #130223 - LaihoE:faster_str_replace, r=thomcc 2024-10-17 16:20:02 +00:00
panic_abort
panic_unwind
portable-simd
proc_macro
profiler_builtins
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Auto merge of #131767 - cuviper:bump-stage0, r=Mark-Simulacrum 2024-10-16 14:40:08 +00:00
stdarch@c881fe3231 stdarch: Bump stdarch submodule 2024-10-10 10:16:16 +00:00
sysroot
test Change a few &Option<T> into Option<&T> 2024-10-08 23:26:29 -04:00
unwind Use throw intrinsic from stdarch in wasm libunwind 2024-10-08 15:50:37 -05:00
windows_targets
Cargo.lock
Cargo.toml