in reply to Re: How to decide the size of block in file transferring?
in thread How to decide the size of block in file transferring?

There simple logic for block size choosing in File::Copy:
Unless given as parameter the block size choosen accordingly to size of the copied file up to 2MB. If the file length less than 512 bytes then the size is set to 1024.

So if OP will use File::Copy than he never know if optimal size more than 2MB. :)

  • Comment on Re^2: How to decide the size of block in file transferring?

Replies are listed 'Best First'.
Re^3: How to decide the size of block in file transferring?
by GrandFather (Saint) on Nov 18, 2008 at 09:02 UTC

    Optimal size is likely to be an order of magnitude smaller than 2 MB. Beyond a few tens of KB any gains are likely to be very small. At some point swapping will become an issue with a dramatic decrease in throughput. Allowing a 2 MB buffer seems fairly generous given the current state of technology and even just a few years ago would have been ridiculously large.


    Perl reduces RSI - it saves typing