This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 7fdddd1
authored
Unrolled build for rust-lang#130991
Rollup merge of rust-lang#130991 - LaihoE:vectorized_slice_contains, r=Noratrieb
Vectorized SliceContains
Godbolt for the u32 case: https://rust.godbolt.org/z/exT9xYWGs
Unsure about:
- Should align_to be used? It didn't seem to matter in my benchmark but maybe I was lucky with alignment?
- Should u8/i8 also be implemented? Currently uses memchr (SWAR)
Some benchmarks on x86 (contains called on an array with no matches, worst case may be slightly worse):
## Large N

## Small N
1 file changed
+26
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
0 commit comments