Tal Peer wrote:
hello,
this patch tries to fix the performance issues described in bug #19771.
i cannot benchmark this at the moment, so if anyone can, please do.
the patch is available at http://tal.madcode.org/file.c.patch

and thanks to wez :)

It's not related to file(), but I found another problem.
Sorry, I don't have time look into.


[yohgaki@dev DEV]$ ./sapi/cli/php t.php
-------------------------------------------------------------
marker    time index            ex time               perct
-------------------------------------------------------------
Start     1034948606.60534400   -                       0.00%
-------------------------------------------------------------
Stop      1034948607.94562700   1.3402829170227       100.00%
-------------------------------------------------------------
total     -                     1.3402829170227       100.00%
-------------------------------------------------------------


/home/yohgaki/cvs/php.net/DEV/Zend/zend_hash.c(406) :  Freeing 0x08E84D74 (35 bytes), script=t.php
Last leak repeated 47438 times
/home/yohgaki/cvs/php.net/DEV/Zend/zend_API.c(846) :  Freeing 0x08E84D3C (1 bytes), script=t.php
Last leak repeated 47438 times
/home/yohgaki/cvs/php.net/DEV/Zend/zend_API.c(845) :  Freeing 0x08E84CFC (12 bytes), script=t.php
Last leak repeated 47438 times
/home/yohgaki/cvs/php.net/DEV/Zend/zend_hash.c(440) :  Freeing 0x08E3E5EC (32768 bytes), script=t.php
Last leak repeated 8 times
/home/yohgaki/cvs/php.net/DEV/ext/standard/string.c(796) :  Freeing 0x08AED524 (44 bytes), script=t.php
/home/yohgaki/cvs/php.net/DEV/Zend/zend_API.c(565) : Actual location (location was relayed)
Last leak repeated 8 times
[yohgaki@dev DEV]$ cat t.php
<?php
$filename = 'libtool';

require("Benchmark/Timer.php");
$time = new Benchmark_Timer;

$time -> setMarker('Start');

$s = '';
for ($i = 0; $i<10; $i++) {
  $fp = fopen($filename,'r');
  while (!feof($fp))
     $s .= fgets($fp);
  $s = explode("\n", $s);
  fclose($fp);
}

$time -> setMarker('Stop');
$time -> display();
?>


[yohgaki@dev DEV]$


--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to