On Sun, Oct 12, 2014 at 7:53 PM, Father Chrysostomos via RT <perlbug-followup@perl.org> wrote: >> I'd considered reading perl source with a buffer size of 4096 to be a >> bug in itself. > > Could you clarify? Reading 4K at a time off disk is going to be inefficient compared to reading larger chunks, especially if we're stopping to expand memory and/or percolate up through the perlio layers each time. When using perlio, the perlio buffer should be the larger of 8192 and BUFSIZ, which increased speed dramatically compare to 4K buffers. See http://perl5.git.perl.org/perl.git/commitdiff/b83080de5c42543809ce9004bcdbcd3162a00e70 Of course 8K is pretty small by today's standards so that could probably be revisited. One of the problems is that the buffer is the same size regardless of whether we're reading off disk or through a pipe. And what's optimal for reading files in general may or may not be optimal for reading Perl source.Thread Previous | Thread Next