ID: 27215 Comment by: alexis dot butplease at nospam dot net Reported By: waboring at 3gstech dot com Status: Open Bug Type: Performance problem Operating System: Redhat 9 PHP Version: 5CVS-2004-02-10 (dev) New Comment:
I installed PHP5RC1 on my WindowsXP so that I can have a look at my oo php4 app and see what I would have to change with PHP5. Unfortunatly with this PHP5, my require_once() calls at the beginning of my scripts become by far the performance bottleneck. Where any page of the app used to take an average 0.2s it now takes about 1.5s, mostly due to require_once() calls. I can't think of migrating because of this. Well, i'm sure it will all be fixed soon :) Keep up the good work. Previous Comments: ------------------------------------------------------------------------ [2004-04-25 11:18:41] olivier dot bichler at laposte dot net I have the same problem with the version : 5CVS-2004-04-24 (dev) Includes are very slow... ------------------------------------------------------------------------ [2004-04-23 09:03:47] hagen at xiag dot ch The same thing on PHP5/Windows XP SP1. I think there's nothing to add to the things said above. PHP5 simply parses code too slow. The bug is extremely easy to reproduce – I’ve tried with different configurations and on different Apache/platform combinations – but it still there. You take any class put it to separate file then include it from another one and measure the time taken by include. The difference between php4 and php5 is up to 15-20 times. ------------------------------------------------------------------------ [2004-03-23 17:44:26] waboring at 3gstech dot com Some more data points. I used apache bench to run the test.php script in my last post. I tested against php 4.3.2 and today's cvs php5. Here are the results. php4: Server Software: Apache/1.3.26 Server Hostname: phphtmllib.hemna.corp.qualys.com Server Port: 80 Document Path: /test.php Document Length: 34 bytes Concurrency Level: 1 Time taken for tests: 9.748 seconds Complete requests: 100 Failed requests: 0 Broken pipe errors: 0 Total transferred: 22900 bytes HTML transferred: 3400 bytes Requests per second: 10.26 [#/sec] (mean) Time per request: 97.48 [ms] (mean) php5: Server Software: Apache/1.3.26 Server Hostname: phphtmllib.hemna.corp.qualys.com Server Port: 80 Document Path: /test.php Document Length: 34 bytes Concurrency Level: 1 Time taken for tests: 39.551 seconds Complete requests: 100 Failed requests: 0 Broken pipe errors: 0 Total transferred: 24300 bytes HTML transferred: 3400 bytes Requests per second: 2.53 [#/sec] (mean) Time per request: 395.51 [ms] (mean) ------------------------------------------------------------------------ [2004-03-23 17:06:45] waboring at 3gstech dot com ok with further testing, I have trimmed my configure line down to the following. ./configure \ -with-apxs=/usr/local/apache/bin/apxs I then restart apache. First hit to the test script .097 s Second hit .187 s third .264 s .332 s .346 s .392 s (peaked out here) In each test, I wait a few seconds to make sure there is no load on the machine. I'm using a seperate machine to run the browser as to not polute the server response times. The entire php script. <?php $_time = explode(" ",microtime()); $start = $_time[1] + $_time[0]; $phphtmllib = "phphtmllib"; include_once( $phphtmllib."/includes.inc"); $_time = explode(" ", microtime()); $stop = $_time[1] + $_time[0]; $elapsed = substr($stop - $start, 0, 5); echo "<i>elapsed time: ".$elapsed." s </i><br>\n"; ?> ------------------------------------------------------------------------ [2004-02-11 15:05:48] [EMAIL PROTECTED] I have not noticed any performance problem with PHP 5, quite the opposite actually. Please provide information how you have configured PHP (what web server is used, are you running PHP5 as CGI or as a module, what configure line was used when compiling PHP, what possible extensions you load in php.ini if any, etc.) (isn't all this mentioned in the instructions about HOW to report???) ------------------------------------------------------------------------ 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 http://bugs.php.net/27215 -- Edit this bug report at http://bugs.php.net/?id=27215&edit=1