Replace the byte-by-byte scan in vim_strbyte() with strchr(), preserving its byte-range and NUL behavior. Add regression coverage for both regexp engines in Latin-1 and UTF-8.
Benchmark: 100 calls to match(input, 'z') on 3,000,000 x bytes, with either no match or one z appended. Times are medians of five runs on the same Linux machine with GCC -O2; before is a96c3bc1f7, after is 6c4e26fbaf.
| Regexp engine | Match position | Before (ms) | After (ms) | Speedup |
|---|---|---|---|---|
| 1 | Absent | 260.865 | 29.894 | 8.73x |
| 1 | End | 224.975 | 28.697 | 7.84x |
| 2 | Absent | 210.428 | 29.356 | 7.17x |
| 2 | End | 165.721 | 28.718 | 5.77x |
Validation: build passed without new warnings; test_regexp_latin (34 tests), test_regexp_utf8 (25 tests), and the Vim9 escape, fnameescape, and shellescape tests passed. Speedups are specific to this benchmark and libc implementation.
https://github.com/vim/vim/pull/21240
(2 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
thanks
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()