rust/library/coretests/benches
Stuart Cook 1c892e829c
Rollup merge of #147436 - okaneco:eq_ignore_ascii_autovec, r=scottmcm
slice/ascii: Optimize `eq_ignore_ascii_case` with auto-vectorization

- Refactor the current functionality into a helper function
- Use `as_chunks` to encourage auto-vectorization in the optimized chunk processing function
- Add a codegen test checking for vectorization and no panicking
- Add benches for `eq_ignore_ascii_case`

---

The optimized function is initially only enabled for x86_64 which has `sse2` as part of its baseline, but none of the code is platform specific. Other platforms with SIMD instructions may also benefit from this implementation.

Performance improvements only manifest for slices of 16 bytes or longer, so the optimized path is gated behind a length check for greater than or equal to 16.

Benchmarks - Cases below 16 bytes are unaffected, cases above all show sizeable improvements.
```
before:
    str::eq_ignore_ascii_case::bench_large_str_eq         4942.30ns/iter +/- 48.20
    str::eq_ignore_ascii_case::bench_medium_str_eq         632.01ns/iter +/- 16.87
    str::eq_ignore_ascii_case::bench_str_17_bytes_eq        16.28ns/iter  +/- 0.45
    str::eq_ignore_ascii_case::bench_str_31_bytes_eq        35.23ns/iter  +/- 2.28
    str::eq_ignore_ascii_case::bench_str_of_8_bytes_eq       7.56ns/iter  +/- 0.22
    str::eq_ignore_ascii_case::bench_str_under_8_bytes_eq    2.64ns/iter  +/- 0.06
after:
    str::eq_ignore_ascii_case::bench_large_str_eq         611.63ns/iter +/- 28.29
    str::eq_ignore_ascii_case::bench_medium_str_eq         77.10ns/iter +/- 19.76
    str::eq_ignore_ascii_case::bench_str_17_bytes_eq        3.49ns/iter  +/- 0.39
    str::eq_ignore_ascii_case::bench_str_31_bytes_eq        3.50ns/iter  +/- 0.27
    str::eq_ignore_ascii_case::bench_str_of_8_bytes_eq      7.27ns/iter  +/- 0.09
    str::eq_ignore_ascii_case::bench_str_under_8_bytes_eq   2.60ns/iter  +/- 0.05
```
2026-01-27 17:36:35 +11:00
..
ascii Relocate bench and use str corpora for data 2025-10-08 14:42:33 -04:00
char Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
hash Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
net Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
num rename uN::{gather,scatter}_bits to uN::{extract,deposit}_bits 2026-01-26 06:28:42 +02:00
str Relocate bench and use str corpora for data 2025-10-08 14:42:33 -04:00
any.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
array.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
ascii.rs Relocate bench and use str corpora for data 2025-10-08 14:42:33 -04:00
fmt.rs benchmarks for exponent fmt of integers 2025-08-22 17:40:48 +02:00
iter.rs library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
lib.rs Implement benchmarks for uN::{gather,scatter}_bits 2025-12-03 20:39:51 +02:00
ops.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
pattern.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
slice.rs Migrate coretests to Rust 2024 2025-02-13 13:10:21 -08:00
str.rs Relocate bench and use str corpora for data 2025-10-08 14:42:33 -04:00
tuple.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00