On Feb 16, 2005, at 2:58 AM, Charles Plessy wrote:

On Thu, Feb 03, 2005 at 11:33:10AM -0800, Henri Asseily wrote :

Also note that DBD::CSV is significantly impacted by I/O speed. If your
IMac G5 has a 4200 rpm drive and your linux box has a 10k rpm one, that
makes quite a large difference.


        Would that mean that running the script twice should
dramatically accelerate the execution because the file would then be
cached in memory? (which does not work, I just tried).


Looks like everything is normal from your dprof output. it just takes a while to access the file.
Assuming your IMac G5 has enough available RAM to use as file buffers when you load the file, try the following command just before running the script:


time cat /path/to/csv/file > /dev/null

This should load the file into memory buffers and tell you the time it took.
Then run the same command again. It should be almost instantaneous, telling you that the file is in RAM.
Only then, run your perl script and see it fly.


FYI on my powerbook, a 'cat' to /dev/null of a 230 meg file takes 11 seconds. The next run takes 0.8 seconds.

H.



Reply via email to