#45265 [Ver]: stripos() very slow

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
 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
 New Comment:

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);
}



Previous Comments:
------------------------------------------------------------------------

[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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.