Auto merge of #160408 - fereidani:str_pattern, r=joboet
Single-byte ASCII searcher for StrSearcherImpl(pattern.rs) This adds a fast single-byte ASCII searcher using memchr. It will be useful when the user is searching for single ASCII tokens such as `\s`,`"`, `'`, `/`, `\n`, etc which are common usecase in many applications. Benchmark results: | Benchmark | Current stable | ByteNeedle PR | Δ | |---|---|---|---| | find_1byte_str_long_nomatch | 36,476 | 3,630 | **−90% (10.0×)** | | find_1byte_str_long_match_end | 37,129 | 3,703 | **−90% (10.0×)** | | rfind_1byte_str_long_nomatch | 35,653 | 3,542 | **−90% (10.1×)** | | split_1byte_str_sparse | 40,289 | 14,555 | **−64% (2.8×)** | | find_1byte_str_short_haystack | 16,970 | 8,140 | −52% (2.1×) | | find_1byte_str_early_return | 16,860 | 10,571 | −37% (1.6×) | | find_str | 6,265 | 5,630 | −10% | | rfind_str | 5,623 | 5,206 | −7% | | find_str_worst_case | 1,192 | 1,104 | −7% | | split_char_dense | 39,598 | 37,823 | −4.5% | | find_char_long_match_end | 3,766 | 3,625 | −3.7% | | split_1byte_str_multibyte_haystack | 78,827 | 76,092 | −3.5% | | find_char_short_haystack | 4,203 | 4,070 | −3% | | find_char_long_nomatch | 3,726 | 3,629 | −2.6% | | split_char_sparse | 13,128 | 12,927 | −1.5% | | ends_with / starts_with (×4) | 272 | 275 | +1% | | rfind_char_long_nomatch | 3,520 | 3,557 | +1% | | rfind_str_worst_case | 27,056 | 27,432 | +1.4% | | split_char_multibyte_haystack | 57,433 | 60,890 | **+6%** | | split_1byte_str_dense | 45,841 | 52,936 | **+15%** | r? joboet
B
bors committed
e702ecae8a3e3756e8a499f8592be1e3efac0e8f