[php-src] PR #24080: ext/mbstring: Optimize valid UTF-8 in mb_substr()
| From: | kamil-tekiela | Date: | Fri, 02 Oct 2026 15:58:13 +0000 |
| Subject: | [php-src] PR #24080: ext/mbstring: Optimize valid UTF-8 in mb_substr() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-39083@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/24080
Author: kamil-tekiela
This PR adds a fast path for valid UTF-8 strings in
mb_substr. It skips bytes in 256
chunks. The performance improvement is noticeable with longer strings and only ones that are flagged
as valid UTF-8.
@alexdowad What do you think? Is this worth doing? I haven't got a fuzzer, but I don't
anticipate any behavioural changes.