develooper Front page | perl.perl5.porters | Postings from October 2014

Re: [perl #122955] [PATCH] speed up building with less disk IO pod moves+__END__+misc

Thread Previous | Thread Next
From:
Craig A. Berry
Date:
October 13, 2014 01:30
Subject:
Re: [perl #122955] [PATCH] speed up building with less disk IO pod moves+__END__+misc
Message ID:
CA+vYcVyhkKKG4kka_QS=SjDUeLa3Rxj380p+L1H8HN8x5Ex9Kw@mail.gmail.com
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About