ID:               22721
 User updated by:  shawn at rumental dot com
 Reported By:      shawn at rumental dot com
-Status:           Closed
+Status:           Open
 Bug Type:         Performance problem
 Operating System: win2k
 PHP Version:      4.3.1
 Assigned To:      wez
 New Comment:

latest win32 Stable (4.3.x-dev)
Built On: Mar 18, 2003 17:30 GMT
http://snaps.php.net/win32/php4-win32-STABLE-200303181730.zip
still yields the same results as before. no change

although Latest CVS (5.0.x-dev) is fast as shit.


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

[2003-03-18 08:49:45] [EMAIL PROTECTED]

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

Fix will be in the next set of snapshots.

FYI, my benchmarks here have the following results (under winxp):

Benchmarking PHP 4.3.0 (without the fix)
Testing file() with 10 iterations with file size: 3323720
file_test(10): 0:29

Benchmarking PHP 5.0.0-dev (using memory mapping)
Testing file() with 10 iterations with file size: 3323720
file_test(10): 0:03

Benchmarking PHP 5.0.0-dev (NOT using memory mapping)
Testing file() with 10 iterations with file size: 3323720
file_test(10): 0:05

This last one is equivalent to the PHP 4.3.x code; I don't have 4.3.x
win32 build env set up here, so this will have to do.



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

[2003-03-18 07:56:38] [EMAIL PROTECTED]

Too many reallocs makes for a slow file() implementation.
PHP5 will have much better performance here under windows with the new
memory mapping support (and will actually have *faster* performance).
I am working on a fix for 4.3.x now.

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

[2003-03-18 06:53:56] shawn at rumental dot com

typo - "USING 4.3.1 should be USING 4.2.2"
my bad

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

[2003-03-17 22:11:57] shawn at rumental dot com

EXAMPLE CODE
-------------------------------------------
set_time_limit ('200');

# logfile is 4mb text file with 17370 LINES
$file="test.log";
$times=10;

$i=1;
while($i <=$times){
$mt = explode(' ', microtime()); $script_start_time = $mt[0] + $mt[1];
file($file);
$mt = explode(' ', microtime()); $script_end_time = $mt[0] + $mt[1];
$time[]=round($script_end_time - $script_start_time, 5);

echo 'file loaded in ', round($script_end_time - $script_start_time,
5), ' seconds<br>';

$i++;
}

$average=array_sum($time)/$times;
echo "average time - ".$average;

---------------------------------------------------
RESULTS:

USING 4.3.1
------------
file loaded in 0.47855 seconds
file loaded in 0.74892 seconds
file loaded in 0.7595 seconds
file loaded in 0.58205 seconds
file loaded in 0.82617 seconds
file loaded in 0.83293 seconds
file loaded in 0.86725 seconds
file loaded in 0.90333 seconds
file loaded in 0.63803 seconds
file loaded in 0.82538 seconds
average time - 0.746211

LATEST STABLE
--------------
file loaded in 16.18174 seconds
file loaded in 16.88304 seconds
file loaded in 16.68356 seconds
file loaded in 16.49004 seconds
file loaded in 16.42378 seconds
file loaded in 16.5862 seconds
file loaded in 16.80012 seconds
file loaded in 16.13519 seconds
file loaded in 25.35214 seconds
file loaded in 32.71799 seconds
average time - 19.02538

results are similar even with smaller files

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

[2003-03-17 09:45:43] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip


Also, add a short but complete example script here which 
can be used to reprodude this problem.


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

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/22721

-- 
Edit this bug report at http://bugs.php.net/?id=22721&edit=1

Reply via email to