Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize mb_strcut for text encodings with mblen_table
For legacy text encodings where mb_strcut is implemented using an mblen_table (such as the various SJIS variants), mb_strcut is now ~30% faster on small strings (about 10 bytes). This is because we are now avoiding an extra, unnecessary copy operation on the output string. When used on large strings, the difference in performance is negligible, as almost the entire runtime is spent stepping through the string to find the starting and ending cut points.
- Loading branch information