On Sun, 12 Oct 2014 20:30:34 -0500, "Craig A. Berry" <craig.a.berry@gmail.com> wrote: > 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. I did a quick inventory of all local mounted file systems on HP-UX I explicitly excluded /stand (linux-talk /boot) as that seems to have a larger block-size than the other FS's All HP-UX versions have 1024 as BUFSIZE in /usr/include/stdio.h bsize /stand 10.20: 1024 8192 (PA2) 11.00: 8192 65536 (PA2) 11.11: 8192 65536 (PA2) 11.23: 8192 65536 (PA2) 11.23: 8192 8192 (IPF) 11.31: 8192 8192 (IPF) # di -l | perl -ne'm{^(/dev\S+)\s+(\S+)} and print "$1\t$2\t", grep /bsize/ => `fstyp -v $1\n`' /dev/vg00/lvol3 / f_bsize: 8192 /dev/vg00/data /data f_bsize: 8192 /dev/vg00/home /home f_bsize: 8192 /dev/vg00/opt /opt f_bsize: 8192 /dev/vg00/pro /pro f_bsize: 8192 /dev/vg00/prodb /prodb f_bsize: 8192 /dev/vg00/lvol1 /stand f_bsize: 8192 /dev/vg00/tmp /tmp f_bsize: 8192 /dev/vg00/usr /usr f_bsize: 8192 /dev/vg00/lvol8 /var f_bsize: 8192 /dev/vg00/wrk /wrk f_bsize: 8192 -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.19 porting perl5 on HP-UX, AIX, and openSUSE http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/Thread Previous | Thread Next