On 05.03.2020 at 15:33, Rowan Tommins wrote: > On Thu, 5 Mar 2020 at 11:59, Aleksander Machniak <a...@alec.pl> wrote: >
>> Also, I have a case in which iconv_* functions were much much slower >> than mbstring. See wordwrap implementation in >> >> https://github.com/roundcube/roundcubemail/blob/master/program/lib/Roundcube/rcube_mime.php#L589 > > Either I misread, or you did: I thought that's exactly what Christoph was > saying, that iconv_* functions will be slower because they basically do > convert-process-unconvert rather than having implementations for each > encoding. So mb_strlen will always be faster than iconv_strlen. > > iconv() vs mb_convert_encoding() doesn't have the same penalty. It seems > quite plausible that a library dedicated to converting charsets would be > more optimised for that job than a single function in a larger library > mainly focussed on working with one charset at a time. I should add that all my testing was done solely with a current libiconv version (on Windows); I don't know how libc's ivonc() and other implementations might perform. -- Christoph M. Becker -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php