Commit 74bb90a
authored
SWAR-optimize ASCII fast paths in String.length and String.slice (#15255)
Add 56-bit SWAR (SIMD Within A Register) acceleration to skip_length/2
and byte_size_remaining_at/2, processing 8 ASCII bytes per iteration
instead of one. Uses the Mycroft zero-byte detection algorithm to
validate that 7+1 bytes are all ASCII with no \r in a single guard.
This mirrors the approach taken in OTP's string module
(OTP erlang/otp#10948).1 parent 5d794ab commit 74bb90a
1 file changed
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2290 | 2290 | | |
2291 | 2291 | | |
2292 | 2292 | | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
2293 | 2306 | | |
2294 | 2307 | | |
2295 | 2308 | | |
| |||
3213 | 3226 | | |
3214 | 3227 | | |
3215 | 3228 | | |
3216 | | - | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
| 3234 | + | |
| 3235 | + | |
3217 | 3236 | | |
3218 | 3237 | | |
3219 | 3238 | | |
| |||
0 commit comments