Ask a Question related to PHP Bugs, Design and Development.
-
mark dot pearson at capita dot co dot uk #1
#38825 [NEW]: including a file is slower than expected
From: mark dot pearson at capita dot co dot uk
Operating system: Windows Server 2003
PHP version: 5.1.6
PHP Bug Type: Performance problem
Bug description: including a file is slower than expected
Description:
------------
Having recently set up a Windows Server 2003 web development server it has
been found that file access by way of PHP 'include' is much slower than it
should be when compared to other platforms.
A small benchmark script (included) was run on four different platforms
(none of them production servers), using both PHP4 and PHP5 as described
below:
PLATFORM 1
----------
System:
Microsoft Windows XP
Professional
Version 2002
Service Pack 2
Computer:
Intel(R) Pentium(R) M processor 1600MHz
589 MHz, 512 MB of RAM
PHP versions tested:
4.4.4 and 5.2 2006-09-13 snapshot
PLATFORM 2
----------
System:
Microsoft Windows Server 2003
Enterprise Edition
Service Pack 1
Computer:
Intel(R) Xeon(TM) CPU 2.80GHz
2.80Ghz, 2.00GB of RAM
Physical Address Extension
PHP versions tested:
4.4.4 and 5.2 2006-09-13 snapshot
PLATFORM 3
----------
System:
Microsoft Windows Server 2003
Standard Edition
Service Pack 1
Computer:
Intel(R) Xeon(TM) CPU 3.00GHz
3.00Ghz, 3.50GB of RAM
PHP versions tested:
4.4.4 and 5.1.6
PLATFORM 4
----------
Fedora Core 4
Pentium 3 760MHz
256MB of RAM
4.3.11
The benchmark script was run 6 times on each platform.
Reproduce code:
---------------
benchmark.php
-------------
<?php
$tmp = split(" ",microtime());
$start = $tmp[0] + $tmp[1];
for ($i = 0; $i < 5000; $i++){
include 'emptyfile.php';
}
$tmp = split(" ",microtime());
$end = $tmp[0] + $tmp[1];
print "Elapsed time: " . ($end - $start) . "\n";
?>
emptyfile.php
-------------
<?php ?>
Expected result:
----------------
I would expect the benchmark.php script to run more quickly on both
PLATFORM 2 and PLATFORM 3 (both of which are high spec servers running
Windows 2003 Server) than on PLATFORM 1 (a Compaq nx7010 laptop running
Windows XP Pro) or PLATFORM 4 (a Dell Optiplex GX110 running Fedora Core
4).
Actual result:
--------------
The script completed more quickly even on PLATFORM 4 (Pentium 3 730MHz
256MB RAM) than on PLATFORM 2 and 3
The results are included below:
PLATFORM 1 - with no other apps running
=======================================
PHP 4.3.11
----------Elapsed time: 0.87640404701233>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.89498400688171>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.98714590072632>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.92531800270081>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.94181489944458>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.92592406272888>C:\php4\cli\php.exe -n benchmark.php
PHP 5.2 (2006-09-13 snapshot)
-----------------------------
Elapsed time: 0.6999979019165>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.61439085006714>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.66567397117615>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.61945104598999>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.64544701576233>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.60436511039734>C:\php5\php.exe -n benchmark.php
PLATFORM 2 - With no other apps running
=======================================
PHP 4.4.4
---------
Elapsed time: 2.6818718910217>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.6455881595612>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.6652920246124>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.8808929920197>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.7031700611115>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.6331689357758>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
PHP 5.2 (2006-09-13 snapshot)
-----------------------------
Elapsed time: 1.5149850845337>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5081758499146>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5118081569672>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5036170482635>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.500696182251>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5246729850769>D:\PHP\php.exe -n benchmark.php
PLATFORM 3 - With no other apps running
=======================================
PHP 5.1.6
---------
Elapsed time: 0.79046392440796>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.79226303100586>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.78908896446228>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.79035115242004>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.78956294059753>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.78894019126892>C:\PHP\php.exe -n benchmark.php
PHP 4.4.4
---------
Elapsed time: 1.2411949634552>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2386450767517>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2364308834076>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.23734998703>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2394840717316>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2390379905701>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
PLATFORM 4 - with no other apps running
=======================================
PHP 4.3.11 (cli) (built: Nov 15 2005 12:17:31)
----------------------------------------------
$ php -n benchmark.php
Elapsed time: 0.54825496673584
$ php -n benchmark.php
Elapsed time: 0.51459383964539
$ php -n benchmark.php
Elapsed time: 0.51424598693848
$ php -n benchmark.php
Elapsed time: 0.54676699638367
$ php -n benchmark.php
Elapsed time: 0.54855012893677
$ php -n benchmark.php
Elapsed time: 0.51129794120789
--
Edit bug report at [url]http://bugs.php.net/?id=38825&edit=1[/url]
--
Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=38825&r=trysnapshot44[/url]
Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=38825&r=trysnapshot52[/url]
Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=38825&r=trysnapshot60[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=38825&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=38825&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=38825&r=needtrace[/url]
Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=38825&r=needscript[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=38825&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=38825&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=38825&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=38825&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=38825&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=38825&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=38825&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=38825&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=38825&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=38825&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=38825&r=float[/url]
No Zend Extensions: [url]http://bugs.php.net/fix.php?id=38825&r=nozend[/url]
MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=38825&r=mysqlcfg[/url]
mark dot pearson at capita dot co dot uk Guest
-
Slower printing from PDF compared to same file in ID
I am currently creating pdfs for print from ID. I email them to CA to have color copies printed. They print about 900 color copies from this pdf on a... -
including file and paths
Hi, I have a script in a folder below root, call it 'folder/script.php'. I want to include another script from a different folder in it, call it... -
#25645 [Csd->Bgs]: Error including a PHP file from within an SSI
ID: 25645 Updated by: sniper@php.net Reported By: makull at freemail dot nl -Status: Closed +Status: ... -
execute a remote file before including it.
I'm trying to modify a banner display function so it can be including on remote websites. If I just include the file from a remote website the... -
File::Find is slower than using recursion!?
One of my colleagues who is new to Perl wrote a script that used recursion to do what File::Find is designed to do (he didn't know about... -
iliaa@php.net #2
#38825 [Opn->Bgs]: including a file is slower than expected
ID: 38825
Updated by: [email]iliaa@php.net[/email]
Reported By: mark dot pearson at capita dot co dot uk
-Status: Open
+Status: Bogus
Bug Type: Performance problem
Operating System: Windows Server 2003
PHP Version: 5.1.6
New Comment:
The include process is identical on all Win32 systems, any
slowdowns are likely to be related to either the drive speed
or the OS internals.
That said one of the reasons you are getting such bad
numbers is because you are using a partial path PHP needs to
resolve first. This compounded with ZTS mode makes things
very slow, change the include statement to use full paths
and you'll see much improved performance, not to mention
much more consistent numbers.
Previous Comments:
------------------------------------------------------------------------
[2006-09-14 11:25:24] mark dot pearson at capita dot co dot uk
Description:
------------
Having recently set up a Windows Server 2003 web development server it
has been found that file access by way of PHP 'include' is much slower
than it should be when compared to other platforms.
A small benchmark script (included) was run on four different platforms
(none of them production servers), using both PHP4 and PHP5 as described
below:
PLATFORM 1
----------
System:
Microsoft Windows XP
Professional
Version 2002
Service Pack 2
Computer:
Intel(R) Pentium(R) M processor 1600MHz
589 MHz, 512 MB of RAM
PHP versions tested:
4.4.4 and 5.2 2006-09-13 snapshot
PLATFORM 2
----------
System:
Microsoft Windows Server 2003
Enterprise Edition
Service Pack 1
Computer:
Intel(R) Xeon(TM) CPU 2.80GHz
2.80Ghz, 2.00GB of RAM
Physical Address Extension
PHP versions tested:
4.4.4 and 5.2 2006-09-13 snapshot
PLATFORM 3
----------
System:
Microsoft Windows Server 2003
Standard Edition
Service Pack 1
Computer:
Intel(R) Xeon(TM) CPU 3.00GHz
3.00Ghz, 3.50GB of RAM
PHP versions tested:
4.4.4 and 5.1.6
PLATFORM 4
----------
Fedora Core 4
Pentium 3 760MHz
256MB of RAM
4.3.11
The benchmark script was run 6 times on each platform.
Reproduce code:
---------------
benchmark.php
-------------
<?php
$tmp = split(" ",microtime());
$start = $tmp[0] + $tmp[1];
for ($i = 0; $i < 5000; $i++){
include 'emptyfile.php';
}
$tmp = split(" ",microtime());
$end = $tmp[0] + $tmp[1];
print "Elapsed time: " . ($end - $start) . "\n";
?>
emptyfile.php
-------------
<?php ?>
Expected result:
----------------
I would expect the benchmark.php script to run more quickly on both
PLATFORM 2 and PLATFORM 3 (both of which are high spec servers running
Windows 2003 Server) than on PLATFORM 1 (a Compaq nx7010 laptop running
Windows XP Pro) or PLATFORM 4 (a Dell Optiplex GX110 running Fedora Core
4).
Actual result:
--------------
The script completed more quickly even on PLATFORM 4 (Pentium 3 730MHz
256MB RAM) than on PLATFORM 2 and 3
The results are included below:
PLATFORM 1 - with no other apps running
=======================================
PHP 4.3.11
----------Elapsed time: 0.87640404701233>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.89498400688171>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.98714590072632>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.92531800270081>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.94181489944458>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.92592406272888>C:\php4\cli\php.exe -n benchmark.php
PHP 5.2 (2006-09-13 snapshot)
-----------------------------
Elapsed time: 0.6999979019165>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.61439085006714>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.66567397117615>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.61945104598999>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.64544701576233>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.60436511039734>C:\php5\php.exe -n benchmark.php
PLATFORM 2 - With no other apps running
=======================================
PHP 4.4.4
---------
Elapsed time: 2.6818718910217>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.6455881595612>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.6652920246124>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.8808929920197>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.7031700611115>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.6331689357758>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
PHP 5.2 (2006-09-13 snapshot)
-----------------------------
Elapsed time: 1.5149850845337>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5081758499146>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5118081569672>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5036170482635>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.500696182251>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5246729850769>D:\PHP\php.exe -n benchmark.php
PLATFORM 3 - With no other apps running
=======================================
PHP 5.1.6
---------
Elapsed time: 0.79046392440796>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.79226303100586>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.78908896446228>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.79035115242004>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.78956294059753>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.78894019126892>C:\PHP\php.exe -n benchmark.php
PHP 4.4.4
---------
Elapsed time: 1.2411949634552>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2386450767517>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2364308834076>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.23734998703>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2394840717316>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2390379905701>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
PLATFORM 4 - with no other apps running
=======================================
PHP 4.3.11 (cli) (built: Nov 15 2005 12:17:31)
----------------------------------------------
$ php -n benchmark.php
Elapsed time: 0.54825496673584
$ php -n benchmark.php
Elapsed time: 0.51459383964539
$ php -n benchmark.php
Elapsed time: 0.51424598693848
$ php -n benchmark.php
Elapsed time: 0.54676699638367
$ php -n benchmark.php
Elapsed time: 0.54855012893677
$ php -n benchmark.php
Elapsed time: 0.51129794120789
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=38825&edit=1[/url]
iliaa@php.net Guest
-
mark dot pearson at capita dot co dot uk #3
#38825 [Bgs->Opn]: including a file is slower than expected
ID: 38825
User updated by: mark dot pearson at capita dot co dot uk
Reported By: mark dot pearson at capita dot co dot uk
-Status: Bogus
+Status: Open
Bug Type: Performance problem
Operating System: Windows Server 2003
PHP Version: 5.1.6
New Comment:
I changed the path in my benchmark script to say both:
include './emptyfile.php';
and
include 'C:/www/php5tests/emptyfile.php';
and it made no difference whatsoever to the performance of the script,
contrary to what was suggested.
Previous Comments:
------------------------------------------------------------------------
[2006-10-18 14:18:56] [email]iliaa@php.net[/email]
The include process is identical on all Win32 systems, any
slowdowns are likely to be related to either the drive speed
or the OS internals.
That said one of the reasons you are getting such bad
numbers is because you are using a partial path PHP needs to
resolve first. This compounded with ZTS mode makes things
very slow, change the include statement to use full paths
and you'll see much improved performance, not to mention
much more consistent numbers.
------------------------------------------------------------------------
[2006-09-14 11:25:24] mark dot pearson at capita dot co dot uk
Description:
------------
Having recently set up a Windows Server 2003 web development server it
has been found that file access by way of PHP 'include' is much slower
than it should be when compared to other platforms.
A small benchmark script (included) was run on four different platforms
(none of them production servers), using both PHP4 and PHP5 as described
below:
PLATFORM 1
----------
System:
Microsoft Windows XP
Professional
Version 2002
Service Pack 2
Computer:
Intel(R) Pentium(R) M processor 1600MHz
589 MHz, 512 MB of RAM
PHP versions tested:
4.4.4 and 5.2 2006-09-13 snapshot
PLATFORM 2
----------
System:
Microsoft Windows Server 2003
Enterprise Edition
Service Pack 1
Computer:
Intel(R) Xeon(TM) CPU 2.80GHz
2.80Ghz, 2.00GB of RAM
Physical Address Extension
PHP versions tested:
4.4.4 and 5.2 2006-09-13 snapshot
PLATFORM 3
----------
System:
Microsoft Windows Server 2003
Standard Edition
Service Pack 1
Computer:
Intel(R) Xeon(TM) CPU 3.00GHz
3.00Ghz, 3.50GB of RAM
PHP versions tested:
4.4.4 and 5.1.6
PLATFORM 4
----------
Fedora Core 4
Pentium 3 760MHz
256MB of RAM
4.3.11
The benchmark script was run 6 times on each platform.
Reproduce code:
---------------
benchmark.php
-------------
<?php
$tmp = split(" ",microtime());
$start = $tmp[0] + $tmp[1];
for ($i = 0; $i < 5000; $i++){
include 'emptyfile.php';
}
$tmp = split(" ",microtime());
$end = $tmp[0] + $tmp[1];
print "Elapsed time: " . ($end - $start) . "\n";
?>
emptyfile.php
-------------
<?php ?>
Expected result:
----------------
I would expect the benchmark.php script to run more quickly on both
PLATFORM 2 and PLATFORM 3 (both of which are high spec servers running
Windows 2003 Server) than on PLATFORM 1 (a Compaq nx7010 laptop running
Windows XP Pro) or PLATFORM 4 (a Dell Optiplex GX110 running Fedora Core
4).
Actual result:
--------------
The script completed more quickly even on PLATFORM 4 (Pentium 3 730MHz
256MB RAM) than on PLATFORM 2 and 3
The results are included below:
PLATFORM 1 - with no other apps running
=======================================
PHP 4.3.11
----------Elapsed time: 0.87640404701233>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.89498400688171>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.98714590072632>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.92531800270081>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.94181489944458>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.92592406272888>C:\php4\cli\php.exe -n benchmark.php
PHP 5.2 (2006-09-13 snapshot)
-----------------------------
Elapsed time: 0.6999979019165>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.61439085006714>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.66567397117615>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.61945104598999>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.64544701576233>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.60436511039734>C:\php5\php.exe -n benchmark.php
PLATFORM 2 - With no other apps running
=======================================
PHP 4.4.4
---------
Elapsed time: 2.6818718910217>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.6455881595612>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.6652920246124>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.8808929920197>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.7031700611115>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.6331689357758>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
PHP 5.2 (2006-09-13 snapshot)
-----------------------------
Elapsed time: 1.5149850845337>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5081758499146>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5118081569672>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5036170482635>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.500696182251>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5246729850769>D:\PHP\php.exe -n benchmark.php
PLATFORM 3 - With no other apps running
=======================================
PHP 5.1.6
---------
Elapsed time: 0.79046392440796>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.79226303100586>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.78908896446228>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.79035115242004>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.78956294059753>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.78894019126892>C:\PHP\php.exe -n benchmark.php
PHP 4.4.4
---------
Elapsed time: 1.2411949634552>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2386450767517>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2364308834076>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.23734998703>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2394840717316>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2390379905701>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
PLATFORM 4 - with no other apps running
=======================================
PHP 4.3.11 (cli) (built: Nov 15 2005 12:17:31)
----------------------------------------------
$ php -n benchmark.php
Elapsed time: 0.54825496673584
$ php -n benchmark.php
Elapsed time: 0.51459383964539
$ php -n benchmark.php
Elapsed time: 0.51424598693848
$ php -n benchmark.php
Elapsed time: 0.54676699638367
$ php -n benchmark.php
Elapsed time: 0.54855012893677
$ php -n benchmark.php
Elapsed time: 0.51129794120789
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=38825&edit=1[/url]
mark dot pearson at capita dot co dot uk Guest
-
iliaa@php.net #4
#38825 [Opn->Fbk]: including a file is slower than expected
ID: 38825
Updated by: [email]iliaa@php.net[/email]
Reported By: mark dot pearson at capita dot co dot uk
-Status: Open
+Status: Feedback
Bug Type: Performance problem
Operating System: Windows Server 2003
PHP Version: 5.1.6
New Comment:
Please try using this CVS snapshot:
[url]http://snaps.php.net/php5.2-latest.tar.gz[/url]
For Windows:
[url]http://snaps.php.net/win32/php5.2-win32-latest.zip[/url]
Previous Comments:
------------------------------------------------------------------------
[2006-11-08 14:59:26] mark dot pearson at capita dot co dot uk
I changed the path in my benchmark script to say both:
include './emptyfile.php';
and
include 'C:/www/php5tests/emptyfile.php';
and it made no difference whatsoever to the performance of the script,
contrary to what was suggested.
------------------------------------------------------------------------
[2006-10-18 14:18:56] [email]iliaa@php.net[/email]
The include process is identical on all Win32 systems, any
slowdowns are likely to be related to either the drive speed
or the OS internals.
That said one of the reasons you are getting such bad
numbers is because you are using a partial path PHP needs to
resolve first. This compounded with ZTS mode makes things
very slow, change the include statement to use full paths
and you'll see much improved performance, not to mention
much more consistent numbers.
------------------------------------------------------------------------
[2006-09-14 11:25:24] mark dot pearson at capita dot co dot uk
Description:
------------
Having recently set up a Windows Server 2003 web development server it
has been found that file access by way of PHP 'include' is much slower
than it should be when compared to other platforms.
A small benchmark script (included) was run on four different platforms
(none of them production servers), using both PHP4 and PHP5 as described
below:
PLATFORM 1
----------
System:
Microsoft Windows XP
Professional
Version 2002
Service Pack 2
Computer:
Intel(R) Pentium(R) M processor 1600MHz
589 MHz, 512 MB of RAM
PHP versions tested:
4.4.4 and 5.2 2006-09-13 snapshot
PLATFORM 2
----------
System:
Microsoft Windows Server 2003
Enterprise Edition
Service Pack 1
Computer:
Intel(R) Xeon(TM) CPU 2.80GHz
2.80Ghz, 2.00GB of RAM
Physical Address Extension
PHP versions tested:
4.4.4 and 5.2 2006-09-13 snapshot
PLATFORM 3
----------
System:
Microsoft Windows Server 2003
Standard Edition
Service Pack 1
Computer:
Intel(R) Xeon(TM) CPU 3.00GHz
3.00Ghz, 3.50GB of RAM
PHP versions tested:
4.4.4 and 5.1.6
PLATFORM 4
----------
Fedora Core 4
Pentium 3 760MHz
256MB of RAM
4.3.11
The benchmark script was run 6 times on each platform.
Reproduce code:
---------------
benchmark.php
-------------
<?php
$tmp = split(" ",microtime());
$start = $tmp[0] + $tmp[1];
for ($i = 0; $i < 5000; $i++){
include 'emptyfile.php';
}
$tmp = split(" ",microtime());
$end = $tmp[0] + $tmp[1];
print "Elapsed time: " . ($end - $start) . "\n";
?>
emptyfile.php
-------------
<?php ?>
Expected result:
----------------
I would expect the benchmark.php script to run more quickly on both
PLATFORM 2 and PLATFORM 3 (both of which are high spec servers running
Windows 2003 Server) than on PLATFORM 1 (a Compaq nx7010 laptop running
Windows XP Pro) or PLATFORM 4 (a Dell Optiplex GX110 running Fedora Core
4).
Actual result:
--------------
The script completed more quickly even on PLATFORM 4 (Pentium 3 730MHz
256MB RAM) than on PLATFORM 2 and 3
The results are included below:
PLATFORM 1 - with no other apps running
=======================================
PHP 4.3.11
----------Elapsed time: 0.87640404701233>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.89498400688171>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.98714590072632>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.92531800270081>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.94181489944458>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.92592406272888>C:\php4\cli\php.exe -n benchmark.php
PHP 5.2 (2006-09-13 snapshot)
-----------------------------
Elapsed time: 0.6999979019165>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.61439085006714>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.66567397117615>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.61945104598999>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.64544701576233>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.60436511039734>C:\php5\php.exe -n benchmark.php
PLATFORM 2 - With no other apps running
=======================================
PHP 4.4.4
---------
Elapsed time: 2.6818718910217>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.6455881595612>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.6652920246124>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.8808929920197>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.7031700611115>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.6331689357758>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
PHP 5.2 (2006-09-13 snapshot)
-----------------------------
Elapsed time: 1.5149850845337>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5081758499146>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5118081569672>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5036170482635>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.500696182251>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5246729850769>D:\PHP\php.exe -n benchmark.php
PLATFORM 3 - With no other apps running
=======================================
PHP 5.1.6
---------
Elapsed time: 0.79046392440796>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.79226303100586>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.78908896446228>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.79035115242004>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.78956294059753>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.78894019126892>C:\PHP\php.exe -n benchmark.php
PHP 4.4.4
---------
Elapsed time: 1.2411949634552>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2386450767517>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2364308834076>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.23734998703>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2394840717316>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2390379905701>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
PLATFORM 4 - with no other apps running
=======================================
PHP 4.3.11 (cli) (built: Nov 15 2005 12:17:31)
----------------------------------------------
$ php -n benchmark.php
Elapsed time: 0.54825496673584
$ php -n benchmark.php
Elapsed time: 0.51459383964539
$ php -n benchmark.php
Elapsed time: 0.51424598693848
$ php -n benchmark.php
Elapsed time: 0.54676699638367
$ php -n benchmark.php
Elapsed time: 0.54855012893677
$ php -n benchmark.php
Elapsed time: 0.51129794120789
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=38825&edit=1[/url]
iliaa@php.net Guest
-
mark dot pearson at capita dot co dot uk #5
#38825 [NoF->Opn]: including a file is slower than expected
ID: 38825
User updated by: mark dot pearson at capita dot co dot uk
Reported By: mark dot pearson at capita dot co dot uk
-Status: No Feedback
+Status: Open
Bug Type: Performance problem
Operating System: Windows Server 2003
PHP Version: 5.1.6
New Comment:
Running the benchmark script again on Platform 2 (Windows Server 2003
Xeon 2.80GHz processor) and the latest PHP5.2 snapshot gives the
following results:
D:\www\php5tests>D:\php5.2\php.exe -n benchmark.php
Elapsed time: 1.3624229431152
D:\www\php5tests>D:\php5.2\php.exe -n benchmark.php
Elapsed time: 1.338228225708
D:\www\php5tests>D:\php5.2\php.exe -n benchmark.php
Elapsed time: 1.3370630741119
D:\www\php5tests>D:\php5.2\php.exe -n benchmark.php
Elapsed time: 1.3375468254089
D:\www\php5tests>D:\php5.2\php.exe -n benchmark.php
Elapsed time: 1.3394939899445
D:\www\php5tests>D:\php5.2\php.exe -n benchmark.php
Elapsed time: 1.3721809387207
D:\www\php5tests>D:\php5.2\php.exe -n benchmark.php
Elapsed time: 1.3796901702881
This still seems slow given that the same benchmark script gives an
average execution time of 0.52 seconds on Platform 1 (Windows XP
laptop) with the same PHP5.2 snapshot.
Previous Comments:
------------------------------------------------------------------------
[2006-11-21 01:00:00] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2006-11-13 15:15:44] [email]iliaa@php.net[/email]
Please try using this CVS snapshot:
[url]http://snaps.php.net/php5.2-latest.tar.gz[/url]
For Windows:
[url]http://snaps.php.net/win32/php5.2-win32-latest.zip[/url]
------------------------------------------------------------------------
[2006-11-08 14:59:26] mark dot pearson at capita dot co dot uk
I changed the path in my benchmark script to say both:
include './emptyfile.php';
and
include 'C:/www/php5tests/emptyfile.php';
and it made no difference whatsoever to the performance of the script,
contrary to what was suggested.
------------------------------------------------------------------------
[2006-10-18 14:18:56] [email]iliaa@php.net[/email]
The include process is identical on all Win32 systems, any
slowdowns are likely to be related to either the drive speed
or the OS internals.
That said one of the reasons you are getting such bad
numbers is because you are using a partial path PHP needs to
resolve first. This compounded with ZTS mode makes things
very slow, change the include statement to use full paths
and you'll see much improved performance, not to mention
much more consistent numbers.
------------------------------------------------------------------------
[2006-09-14 11:25:24] mark dot pearson at capita dot co dot uk
Description:
------------
Having recently set up a Windows Server 2003 web development server it
has been found that file access by way of PHP 'include' is much slower
than it should be when compared to other platforms.
A small benchmark script (included) was run on four different platforms
(none of them production servers), using both PHP4 and PHP5 as described
below:
PLATFORM 1
----------
System:
Microsoft Windows XP
Professional
Version 2002
Service Pack 2
Computer:
Intel(R) Pentium(R) M processor 1600MHz
589 MHz, 512 MB of RAM
PHP versions tested:
4.4.4 and 5.2 2006-09-13 snapshot
PLATFORM 2
----------
System:
Microsoft Windows Server 2003
Enterprise Edition
Service Pack 1
Computer:
Intel(R) Xeon(TM) CPU 2.80GHz
2.80Ghz, 2.00GB of RAM
Physical Address Extension
PHP versions tested:
4.4.4 and 5.2 2006-09-13 snapshot
PLATFORM 3
----------
System:
Microsoft Windows Server 2003
Standard Edition
Service Pack 1
Computer:
Intel(R) Xeon(TM) CPU 3.00GHz
3.00Ghz, 3.50GB of RAM
PHP versions tested:
4.4.4 and 5.1.6
PLATFORM 4
----------
Fedora Core 4
Pentium 3 760MHz
256MB of RAM
4.3.11
The benchmark script was run 6 times on each platform.
Reproduce code:
---------------
benchmark.php
-------------
<?php
$tmp = split(" ",microtime());
$start = $tmp[0] + $tmp[1];
for ($i = 0; $i < 5000; $i++){
include 'emptyfile.php';
}
$tmp = split(" ",microtime());
$end = $tmp[0] + $tmp[1];
print "Elapsed time: " . ($end - $start) . "\n";
?>
emptyfile.php
-------------
<?php ?>
Expected result:
----------------
I would expect the benchmark.php script to run more quickly on both
PLATFORM 2 and PLATFORM 3 (both of which are high spec servers running
Windows 2003 Server) than on PLATFORM 1 (a Compaq nx7010 laptop running
Windows XP Pro) or PLATFORM 4 (a Dell Optiplex GX110 running Fedora Core
4).
Actual result:
--------------
The script completed more quickly even on PLATFORM 4 (Pentium 3 730MHz
256MB RAM) than on PLATFORM 2 and 3
The results are included below:
PLATFORM 1 - with no other apps running
=======================================
PHP 4.3.11
----------Elapsed time: 0.87640404701233>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.89498400688171>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.98714590072632>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.92531800270081>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.94181489944458>C:\php4\cli\php.exe -n benchmark.php
Elapsed time: 0.92592406272888>C:\php4\cli\php.exe -n benchmark.php
PHP 5.2 (2006-09-13 snapshot)
-----------------------------
Elapsed time: 0.6999979019165>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.61439085006714>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.66567397117615>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.61945104598999>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.64544701576233>C:\php5\php.exe -n benchmark.php
Elapsed time: 0.60436511039734>C:\php5\php.exe -n benchmark.php
PLATFORM 2 - With no other apps running
=======================================
PHP 4.4.4
---------
Elapsed time: 2.6818718910217>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.6455881595612>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.6652920246124>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.8808929920197>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.7031700611115>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 2.6331689357758>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
PHP 5.2 (2006-09-13 snapshot)
-----------------------------
Elapsed time: 1.5149850845337>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5081758499146>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5118081569672>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5036170482635>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.500696182251>D:\PHP\php.exe -n benchmark.php
Elapsed time: 1.5246729850769>D:\PHP\php.exe -n benchmark.php
PLATFORM 3 - With no other apps running
=======================================
PHP 5.1.6
---------
Elapsed time: 0.79046392440796>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.79226303100586>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.78908896446228>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.79035115242004>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.78956294059753>C:\PHP\php.exe -n benchmark.php
Elapsed time: 0.78894019126892>C:\PHP\php.exe -n benchmark.php
PHP 4.4.4
---------
Elapsed time: 1.2411949634552>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2386450767517>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2364308834076>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.23734998703>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2394840717316>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
Elapsed time: 1.2390379905701>D:\php-4.4.4-Win32\cli\php.exe -n benchmark.php
PLATFORM 4 - with no other apps running
=======================================
PHP 4.3.11 (cli) (built: Nov 15 2005 12:17:31)
----------------------------------------------
$ php -n benchmark.php
Elapsed time: 0.54825496673584
$ php -n benchmark.php
Elapsed time: 0.51459383964539
$ php -n benchmark.php
Elapsed time: 0.51424598693848
$ php -n benchmark.php
Elapsed time: 0.54676699638367
$ php -n benchmark.php
Elapsed time: 0.54855012893677
$ php -n benchmark.php
Elapsed time: 0.51129794120789
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=38825&edit=1[/url]
mark dot pearson at capita dot co dot uk Guest
-
iliaa@php.net #6
#38825 [Opn->Fbk]: including a file is slower than expected
ID: 38825
Updated by: [email]iliaa@php.net[/email]
Reported By: mark dot pearson at capita dot co dot uk
-Status: Open
+Status: Feedback
Bug Type: Performance problem
Operating System: Windows Server 2003
PHP Version: 5.1.6
New Comment:
Please try using this CVS snapshot:
[url]http://snaps.php.net/php5.2-latest.tar.gz[/url]
For Windows:
[url]http://snaps.php.net/win32/php5.2-win32-latest.zip[/url]
There are a few more Win32 related patches in the code now
that should improve the speed of the file system operations.
Can you give the latest code a try.
Previous Comments:
------------------------------------------------------------------------
[2006-11-27 13:14:25] mark dot pearson at capita dot co dot uk
Running the benchmark script again on Platform 2 (Windows Server 2003
Xeon 2.80GHz processor) and the latest PHP5.2 snapshot gives the
following results:
D:\www\php5tests>D:\php5.2\php.exe -n benchmark.php
Elapsed time: 1.3624229431152
D:\www\php5tests>D:\php5.2\php.exe -n benchmark.php
Elapsed time: 1.338228225708
D:\www\php5tests>D:\php5.2\php.exe -n benchmark.php
Elapsed time: 1.3370630741119
D:\www\php5tests>D:\php5.2\php.exe -n benchmark.php
Elapsed time: 1.3375468254089
D:\www\php5tests>D:\php5.2\php.exe -n benchmark.php
Elapsed time: 1.3394939899445
D:\www\php5tests>D:\php5.2\php.exe -n benchmark.php
Elapsed time: 1.3721809387207
D:\www\php5tests>D:\php5.2\php.exe -n benchmark.php
Elapsed time: 1.3796901702881
This still seems slow given that the same benchmark script gives an
average execution time of 0.52 seconds on Platform 1 (Windows XP
laptop) with the same PHP5.2 snapshot.
------------------------------------------------------------------------
[2006-11-21 01:00:00] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2006-11-13 15:15:44] [email]iliaa@php.net[/email]
Please try using this CVS snapshot:
[url]http://snaps.php.net/php5.2-latest.tar.gz[/url]
For Windows:
[url]http://snaps.php.net/win32/php5.2-win32-latest.zip[/url]
------------------------------------------------------------------------
[2006-11-08 14:59:26] mark dot pearson at capita dot co dot uk
I changed the path in my benchmark script to say both:
include './emptyfile.php';
and
include 'C:/www/php5tests/emptyfile.php';
and it made no difference whatsoever to the performance of the script,
contrary to what was suggested.
------------------------------------------------------------------------
[2006-10-18 14:18:56] [email]iliaa@php.net[/email]
The include process is identical on all Win32 systems, any
slowdowns are likely to be related to either the drive speed
or the OS internals.
That said one of the reasons you are getting such bad
numbers is because you are using a partial path PHP needs to
resolve first. This compounded with ZTS mode makes things
very slow, change the include statement to use full paths
and you'll see much improved performance, not to mention
much more consistent numbers.
------------------------------------------------------------------------
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
[url]http://bugs.php.net/38825[/url]
--
Edit this bug report at [url]http://bugs.php.net/?id=38825&edit=1[/url]
iliaa@php.net Guest



Reply With Quote

