To be honest, I'm not sure if this belongs in Meditations or in Seekers of Perl Wisdom. I opted for here because its more of some observations that I have recently made concerning the File::Copy module. I work with a system that automatically transfers files around for various business units. These transfers are primarily handled by a third-party system and mostly it handles transferring files between Unix/Solaris and Intel/W2K platforms. I work mostly with the Unix side of the equation and I set most everything up to run out of Perl. Recently, we were asked to look at the speed of transferring around 2Gigs+ of data to a separate Unix box. We are really only moving the files into a local directory that is NFS mounted on the remote box. We tried three separate methods, the first from the commandline doing a straight
cp of the files into the destination directory, then I ran a Perl program that looped through and using the
copy method from File::Copy, and lastly, using the third-party software to do the copy (out of the same Perl program). We timed the first method out at about 10 minutes to copy all the files, likewise, the third-party program took about the same amount of time. However, when I ran the Perl program using File::Copy, the time was closer to 4 minutes (give or take a few seconds here and there).
What really intrigues me is why copying the files with File::Copy is so much faster? I can assume that there is some latency introduced when I run the third-party transfer program out of a Perl program since I am forking out to the system to run it, but that might account for maybe a minute or so in total, even that is still quite a bit more than what File::Copy is doing. Anyone have any thoughts on this?
"Ex libris un peut de tout"