|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-07-22 08:47 UTC] ab@php.net
-Status: Open
+Status: Feedback
[2017-07-22 08:47 UTC] ab@php.net
[2017-07-22 10:45 UTC] andxfiles at gmail dot com
[2017-07-22 12:22 UTC] ab@php.net
[2017-07-23 03:14 UTC] andxfiles at gmail dot com
[2017-07-23 19:15 UTC] ab@php.net
[2017-07-24 06:53 UTC] andxfiles at gmail dot com
[2017-07-24 10:30 UTC] ab@php.net
[2017-07-24 22:38 UTC] andxfiles at gmail dot com
[2017-07-26 11:32 UTC] ab@php.net
-Assigned To:
+Assigned To: nikic
[2017-07-26 11:32 UTC] ab@php.net
[2017-07-26 12:54 UTC] ab@php.net
-Status: Feedback
+Status: Closed
[2017-07-26 12:54 UTC] ab@php.net
[2018-10-22 13:10 UTC] andxfiles at gmail dot com
[2018-10-22 13:15 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 17:00:02 2025 UTC |
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