From: lmeyer at ea dot com
Operating system: windows 2003
PHP version: 5.2.5
PHP Bug Type: Performance problem
Bug description: include_once behavior when including UNC file
Description:
------------
When using include_once with an abolute UNC file path, it is really slow
using php 5.2.5, php 5.2.4, and really fast using php 5.2.3
>From the script below :
PHP 5.2.5 :
first include_once : //NAS/nas/www/adodb5/adodb.inc.php
time (ms): 0.068962097167969
include_once count in 5 sec: 240 <<<<<<<<<<
PHP 5.2.3 :
first include_once : //NAS/nas/www/adodb5/adodb.inc.php
time (ms): 0.030542135238647
include_once count in 5 sec: 376054 <<<<<<<<<<
Thanks !
Lo.
Reproduce code:
---------------
<?php
// CASE MATTER !!!!
$absolutepath = '//NAS/nas/www/adodb5/adodb.inc.php';
$durationsec = 5.0;
///////////////////////////////////////////////////////////////////////////////
function sys_sinternal_microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$t = sys_sinternal_microtime_float();
include_once('//NAS/nas/www/ea-land/private/prod/libs/adodb5/adodb.inc.php');
$t = sys_sinternal_microtime_float() - $t;
echo 'first include_once : '.$absolutepath.'<br>';
echo 'time (ms): '.$t.'<br>';
$cnt = 0;
$t = sys_sinternal_microtime_float();
while(sys_sinternal_microtime_float() - $t < $durationsec)
{
$cnt++;
include_once('//NAS/nas/www/ea-land/private/prod/libs/adodb5/adodb.inc.php');
}
echo 'include_once count in '.$durationsec.' sec: '.$cnt;
echo '<br>';
?>
Expected result:
----------------
"Include_once" should include_once should only include a file once whitout
doing extra processing as long as the file has an absolute path.
Actual result:
--------------
It's wotking well with php 5.2.3, but not anymore from php 5.2.4.
--
Edit bug report at http://bugs.php.net/?id=44505&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=44505&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=44505&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=44505&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44505&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=44505&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44505&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44505&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44505&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44505&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44505&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=44505&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=44505&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44505&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44505&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=44505&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44505&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44505&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44505&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44505&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44505&r=mysqlcfg