#44505 [Opn]: include_once behavior when including UNC file

From: Date: Mon, 24 Mar 2008 22:26:19 +0000
Subject: #44505 [Opn]: include_once behavior when including UNC file
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-123584@lists.php.net to get a copy of this message
ID: 44505 User updated by: lmeyer at ea dot com Reported By: lmeyer at ea dot com Status: Open Bug Type: Performance problem Operating System: windows 2003 PHP Version: 5.2.5 New Comment: Adding some results using php 5.2.3 and 5.2.5 : WIN PATH : //NAS/nas/www/adodb5/adodb.inc.php LNX PATH : \\\\NAS\\nas\\www\\adodb5\\adodb.inc.php REALPATH : using realpath as suggested in bug#44125 WIN PATH LNX PATH WIN PATH LNX PATH REALPATH REALPATH PHP 5.2.3 FIRST INCLUDE ONCE (sec) 0.05 0.02 0.07 0.06 5sec. INCLUDE_ONCE (count) 250 338488 232 332800 PHP 5.2.5 FIRST INCLUDE ONCE (sec) 0.08 0.07 0.06 0.14 5sec. INCLUDE_ONCE (count) 215 228 310427 298643 Previous Comments: ------------------------------------------------------------------------ [2008-03-23 12:06:23] felipe@php.net Maybe, related to bug#44125 ------------------------------------------------------------------------ [2008-03-22 17:53:14] lmeyer at ea dot com 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 this bug report at http://bugs.php.net/?id=44505&edit=1

« previous php.bugs (#123584) next »