ID:               41193
 Updated by:       [EMAIL PROTECTED]
 Reported By:      mauroi at digbang dot com
-Status:           Open
+Status:           Assigned
 Bug Type:         Performance problem
 Operating System: Win32
-PHP Version:      5.2.2
+PHP Version:      5.2.3
-Assigned To:      
+Assigned To:      dmitry
 New Comment:

Dmitry, please check this out. 


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

[2007-06-15 02:49:54] [EMAIL PROTECTED]

Just to add to this report - it looks very much like it's impacting
PHP-GTK (CLI only) Windows users too.

The base demo script in the PHP-GTK distro is reportedly 'twice as
slow' under 5.2.3 as it is under 5.1.6 in the same environment with the
same GTK+ libraries in tow.

The base demo script includes a long list of class files via relative
includes. The relevant bit of code goes:

protected function load_demos()
    {
        $files = glob(dirname(__FILE__).'/components/*.php');
        foreach ($files as $id => $file) {
            $GLOBALS['class'] = null;
            if (basename($file) != basename(__FILE__)) {
                if ([EMAIL PROTECTED]($file)) {
                    continue;
                }
etc
(see
http://cvs.php.net/viewvc.cgi/php-gtk/demos/phpgtk2-demo.php?content-type=text%2Fplain&view=co
for the murky details)

The performance difference is also reported as 'visibly noticeable'
between relative and hard-coded paths under 5.2.3, although that's a
less direct comparison.

Ping me if you think I can help with any donkeywork, this one's fairly
major for us and may hold up our 'surprise release', given that the demo
scripts number rather less than the number of includes you could expect
in a RL application.

- Steph

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

[2007-05-09 15:47:49] mauroi at digbang dot com

Thanks Mark... The original example comes from a real life application,
but yours is far much better. Hope someone will take a look at it now
it's simpler.

Regards,
Mauro.

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

[2007-05-09 15:36:37] mark at markwest dot me dot uk

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

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

[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