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

From: Date: Mon, 24 Jul 2017 10:30:09 +0000
Subject: Bug #74929 [Fbk]: mbstring functions version 7.1.1 are slow compared to 5.3 on Windows
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210264@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74929&edit=1 ID: 74929 Updated by: ab@php.net Reported by: andxfiles at gmail dot com Summary: mbstring functions version 7.1.1 are slow compared to 5.3 on Windows Status: Feedback Type: Bug Package: mbstring related Operating System: Windows PHP Version: 7.1.7 Block user comment: N Private report: N New Comment: Thanks for checking. I've tested your snippet now, but the results are somewhat different. 5.3 x86 mb_strlen: 327.4 milliseconds mb_stripos: 3125.6 milliseconds mb_substr: 260.6 milliseconds 5.6 x86 mb_strlen: 293 milliseconds mb_stripos: 3145.3 milliseconds mb_substr: 342.4 milliseconds 7.1 x86 mb_strlen: 432 milliseconds mb_stripos: 5672.8 milliseconds mb_substr: 567.7 milliseconds master x86 mb_strlen: 73.6 milliseconds mb_stripos: 248.5 milliseconds mb_substr: 69.6 milliseconds master x64 mb_strlen: 91.6 milliseconds mb_stripos: 312.6 milliseconds mb_substr: 101.6 milliseconds To see is, that indeed some slowdown made it into PHP 7. The current master however is significant faster that any previous branch, even on 64 bit. Please note, that 7.1 is not master. You need to fetch literally master snapshots from the page linked, the improvements are not anywhere else ATM. Thanks. Previous Comments: ------------------------------------------------------------------------ [2017-07-24 06:53:21] andxfiles at gmail dot com ab@php.net, nikic@php.net: Unfortunately under Windows I still see no difference. New results: 5.3.28: mb_strlen: 309.4 milliseconds mb_stripos: 3523.4 milliseconds mb_substr: 326.6 milliseconds 7.1.1: mb_strlen: 426.3 milliseconds mb_stripos: 4812.5 milliseconds mb_substr: 421.9 milliseconds 7.1.9-dev (master) mb_strlen: 421.9 milliseconds mb_stripos: 4890.6 milliseconds mb_substr: 421.9 milliseconds ------------------------------------------------------------------------ [2017-07-23 19:15:31] ab@php.net @andxfiles, Nikita made quite a few improvements to ext mbstring in master, see bug #74933. I'd say, it would make sense to check some latest master snapshot, to fetch here http://windows.php.net/snapshots/ . We also work on a new PGO approach, so further improvements are to come. Thanks. ------------------------------------------------------------------------ [2017-07-23 03:14:28] andxfiles at gmail dot com Both versions of php are Non Thread Safe. Windows version is: Windows Server 2012 Standard 64bit. However, a user on stackoverflow (link in previous comment) has replicated it in Windows 7 as well. ------------------------------------------------------------------------ [2017-07-22 12:22:34] ab@php.net Ok. As a followup - both use same flavor TS/NTS? Both tested on the same machine? Which exact Widows version? Thanks. ------------------------------------------------------------------------ [2017-07-22 10:45:39] andxfiles at gmail dot com In both cases I'm using 32bit versions of php. One case is php 5.3.28 and the other is 7.1.1. The OS is Windows, the problem does not seem to exist under Linux. Both versions are installed via Web Platform Installer from within IIS. Other people have been able to reproduce it: https://stackoverflow.com/questions/45028018/php-7-mb-multibyte-functions-are-60-slower-than-in-5-3-possibly-windows-on ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=74929 -- Edit this bug report at https://bugs.php.net/bug.php?id=74929&edit=1

« previous php.bugs (#210264) next »