Bug #74929 [NEW]: mbstring functions version 7.1.1 are slow compared to 5.3 on Windows

From: Date: Sat, 15 Jul 2017 13:29:15 +0000
Subject: Bug #74929 [NEW]: mbstring functions version 7.1.1 are slow compared to 5.3 on Windows
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210066@lists.php.net to get a copy of this message
From: andxfiles at gmail dot com Operating system: Windows PHP version: 7.1.7 Package: mbstring related Bug Type: Bug Bug description:mbstring functions version 7.1.1 are slow compared to 5.3 on Windows Description: ------------ PHP's 7.1.1 mb_ (multibyte) functions are ~60% slower compared to PHP 5.3. Example of such functions: mb_strlen, mb_stripos, mb_substr. This affects Windows only. On Linux they seem to be way faster compared to PHP 5.3 and there is no such issue. PHP's 7.1.1 installation was done via WebPI (IIS). Test script: --------------- <?php $starttime = microtime(true); for ($i=0; $i<100000; $i++) { $a = mb_strlen("fdsfdssdfoifjosdifjosdifjosdij:ά", "UTF-8"); } $finishtime = microtime(true); echo "mb_strlen: " . number_format($finishtime - $starttime, 4)*1000 ." milliseconds<br/>"; $starttime = microtime(true); for ($i=0; $i<100000; $i++) { $a = mb_stripos("fdsfdssdfoifjosdifjosdifjosdij:ά", "α", 0, "UTF-8"); } $finishtime = microtime(true); echo "mb_stripos: " . number_format($finishtime - $starttime, 4)*1000 ." milliseconds<br/>"; $starttime = microtime(true); for ($i=0; $i<100000; $i++) { $a = mb_substr("fdsfdssdfoifjosdifjosdifjosdij:ά", $i, 1, "UTF-8"); } $finishtime = microtime(true); echo "mb_substr: " . number_format($finishtime - $starttime, 4)*1000 ." milliseconds<br/>"; ?> Expected result: ---------------- php 5.3.28 mb_strlen: 250 milliseconds mb_stripos: 3078.1 milliseconds mb_substr: 281.3 milliseconds php 7.1.1 mb_strlen: 406.3 milliseconds mb_stripos: 4796.9 milliseconds mb_substr: 421.9 milliseconds -- Edit bug report at https://bugs.php.net/bug.php?id=74929&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74929&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74929&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74929&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74929&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74929&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74929&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74929&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74929&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74929&r=support Expected behavior: https://bugs.php.net/fix.php?id=74929&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74929&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74929&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74929&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74929&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74929&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74929&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74929&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74929&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74929&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74929&r=mysqlcfg

« previous php.bugs (#210066) next »