in reply to Replicate Code

How does it benchmark against:
use File::Copy; copy $source, $dest;

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: •Re: Replicate Code
by innominate (Beadle) on Sep 20, 2002 at 17:19 UTC
    Let's see with 100000 iterations:

    Linux: 3% - 5% slower than File::Copy
    Win32: 25% - 30% faster than File::Copy

    -inno
        You were right!

        After running a number of brain numbing tests, it appears that at a file larger than approx 1k, File::Copy takes the flag (and runs with it). Let alone the fact that print's taking the data line by line. (I also tested syswrite, and when used in a similar way, it is still slower.)

        I guess I'm off to change my scripts now. Oh wait, nevermind, they don't get replicated at that rate anyways (just when they need fixing). But I'll be sure to use File::Copy from now on.

        Thanks,
        -inno