Skip to content

ext/mbstring: Optimize valid UTF-8 in mb_substr() - #24080

Open
kamil-tekiela wants to merge 1 commit into
php:masterfrom
kamil-tekiela:Optimize-mb_substr
Open

kamil-tekiela wants to merge 1 commit into
php:masterfrom
kamil-tekiela:Optimize-mb_substr

Conversation

@kamil-tekiela

Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant