Increase PERLIOBUF_DEFAULT_BUFSIZ to larger of 8192 and BUFSIZ.
authorCraig A. Berry <craigberry@mac.com>
Thu, 17 Feb 2011 20:24:39 +0000 (14:24 -0600)
committerCraig A. Berry <craigberry@mac.com>
Thu, 17 Feb 2011 21:50:18 +0000 (15:50 -0600)
commitb83080de5c42543809ce9004bcdbcd3162a00e70
tree3bb044a972f44b6f7b992f1209661868a63947b4
parentc22d665b55f24cd837419195a9ef11b09877c9cf
Increase PERLIOBUF_DEFAULT_BUFSIZ to larger of 8192 and BUFSIZ.

The previous default size of a PerlIO buffer (4096 bytes) was
chosen many years ago before PerlIO was even the default I/O scheme
for Perl.  Benchmarks show that doubling this decade-old default
increases read and write performance in the neighborhood of 25%
to 50% when using the default layers of perlio on top of unix.

The only situation without a noticeable performance benefit so
far appears to be when physical I/O is so slow that it dwarfs
any savings from the reduction in layer shuffling, but there
is also no performance penalty in this case.

BUFSIZ will be chosen in the unlikely event that it's larger
than 8192 on the assumption that the system maintainers would
not set such a value without good reason.

If the new size causes problems, or to try an even bigger size,
configure with:

  ./Configure -Accflags=-DPERLIOBUF_DEFAULT_BUFSIZ=N

where N is the desired size in bytes; it should probably be a
multiple of your page size.
perlio.h