[Dcphp-dev] Fastest way to read a 100mb+ file?

soazine at erols.com soazine at erols.com
Fri Jul 13 04:20:33 EDT 2007


Sorry but I didn't understand your chart, your numbers all jumbled together

Original Message:
-----------------
From: Hans Lellelid hans at velum.net
Date: Thu, 12 Jul 2007 21:53:17 -0400
To: soazine at erols.com, dcphp-dev at calypso.tux.org
Subject: Re: [Dcphp-dev] Fastest way to read a 100mb+ file?


soazine at erols.com wrote:
> I am trying to find a fast way of getting file size from a very large
> (100mb+) file, used both filesize() and imgstatarray() but both are
> extremely slow, 30 seconds/file average.  Is there a faster way?

When you say both are extremely slow, do you mean imgstatarray() and
filesize() together?  Because filesize() for me is extremely fast:

<?php

require_once 'Benchmark/Timer.php';
$t = new Benchmark_Timer();
$t->start();

print filesize('./test.bin'); // ~100MB file
print "\n";

$t->stop();
$t->display();
?>

Output:

100000000
----------------------------------------------------
marker  time index            ex time         perct
----------------------------------------------------
Start   1184291452.20491200   -                0.00%
----------------------------------------------------
Stop    1184291452.20526200   0.000349998474121 100.00%
----------------------------------------------------
total   -                     0.000349998474121100.00%
----------------------------------------------------


I haven't tested imgstatarray().  Maybe that's where your problem is?
If not, maybe it's a problem w/ your OS ... ?

Hans

--------------------------------------------------------------------
myhosting.com - Premium Microsoft® Windows® and Linux web and application
hosting - http://link.myhosting.com/myhosting




More information about the Dcphp-dev mailing list