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.
/* The default buffer size for the perlio buffering layer */
#ifndef PERLIOBUF_DEFAULT_BUFSIZ
-#define PERLIOBUF_DEFAULT_BUFSIZ 4096
+#define PERLIOBUF_DEFAULT_BUFSIZ (BUFSIZ > 8192 ? BUFSIZ : 8192)
#endif
#ifndef SEEK_SET