ID:               41193
 Comment by:       mark at markwest dot me dot uk
 Reported By:      mauroi at digbang dot com
 Status:           Open
 Bug Type:         Performance problem
 Operating System: Win32
 PHP Version:      5.2.2RC2
 New Comment:

I can reproduce what I believe to be the same issue too.

A very simple test case to highlight this issue is 

<?php
for ($i = 0; $i < 5000; $i++) {
    if (is_readable('test.txt')) {
        // dummy - do nothing!
    }
}
?>

Sample results, measured using xdebug, are as follows

is_readable with non-existent file
5.1.6 5000 calls to is_readable taking 166ms
5.2.2 5000 calls to is_readable taking 1511ms

is_readable with existing file
5.1.6 5000 calls to is_readable taking 135ms
5.2.2 5000 calls to is_readable taking 151ms

When the file isn't present php 5.2.x takes significantly longer that
in previous releases.

-Mark


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

[2007-04-29 00:29:56] mauroi at digbang dot com

Also affects 5.2.2rc2

------------------------------------------------------------------------

[2007-04-25 21:56:14] mauroi at digbang dot com

Description:
------------
First of all, I couldn't reproduce this on Linux. Maybe because it
doesn't exist, or maybe because of worse perfomance on filesystem
operations on Windows.
We've found a performance degradation between PHP5.1.6 and PHP5.2.x
(also checked with PHP5.2.2rc1) when including a file with a relative
path. It gets notorious if using include_path and it has a big number of
directories.
In the provided zip file you'll find 8 directories. Only one of them
contains the file that will be required by the main script. So,
script.php & script1.php show the problem. script.php only requires the
file one time, and even in that case you'll see the difference.
script1.php iterates including a non-existant file (that's why errors ar
supressed) and the execution time is twice as big.
At first glance this could look as a bug with less importance, but any
framework that uses __autoload & include_path with some sort of
frequency, will be slower on PHP5.2 on Windows. Also, any site using MVC
(not even using __autoload) and relative paths could be affected.

Thank you very much.

Reproduce code:
---------------
http://webmail.digbang.com/include_performance.zip

# one inclusion
php -n script.php

# multiple inclusions
php -n script1.php


Expected result:
----------------
Same or better performance on PHP5.2.x than in PHP5.1.6



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41193&edit=1

Reply via email to