ID: 45265
Updated by: [EMAIL PROTECTED]
Reported By: marc at phpmyadmin dot net
Status: Verified
Bug Type: Performance problem
Operating System: win32 only
PHP Version: 5.2CVS-2008-08-10
-Assigned To:
+Assigned To: pajoye
New Comment:
The problem is that the Windows API does check for the locale while
processing the string (isupper, islower used by tolower or toupper).
Using _tolower/_toupper only speed up the functions using it (as fast
or faster than linux). But it does not work for non ASCII input.
I have to check is libc does check for locale as well, if not, I will
happily use _tolower on windows too.
That being said, it may be used too in zend then. tolower is used
*many* times there.
Previous Comments:
------------------------------------------------------------------------
[2008-08-10 17:01:44] [EMAIL PROTECTED]
It seems it's a php_strtolower() issue because we have the same problem
by replacing stripos to strtolower...
The problem occurs on Windows also with strtolower()...
71 seconds on Windows, 25s on linux...
Reproduce code:
$a = str_repeat('x', 100000);
for ($i = 0; $i < 10000; $i++) {
$b = strtolower($a);
}
------------------------------------------------------------------------
[2008-06-13 17:44:20] marc at phpmyadmin dot net
Description:
------------
stripos() is very slow on Windows, about ten times slower than on
Linux.
Reproduce code:
---------------
$a = str_repeat('x', 100000);
for ($i = 0; $i < 10000; $i++) {
$b = stripos($a, 'y');
}
Expected result:
----------------
On Linux it takes about 3 secondes.
Actual result:
--------------
On Windows: 30 seconds
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45265&edit=1