Perl Monk, Perl Meditation | |
PerlMonks |
Re: 4k read buffer is too smallby almut (Canon) |
on Jun 16, 2008 at 21:52 UTC ( [id://692386]=note: print w/replies, xml ) | Need Help?? |
AFAIK, stdio buffering - as configurable via setvbuf - is incompatible with PerlIO's buffering, which is why it's disabled when you configure Perl to use PerlIO. OTOH, you most probably do want PerlIO... so configuring/rebuilding Perl to not use it, isn't really an option. Anyhow, a little digging around suggests that you can "configure" PerlIO's buffer size in the file perlio.c:
At least, I changed that 4096 to 8192, recompiled perl (v5.10.0), and now strace reveals that read(2) is being called for blocks of size 8192, when you execute something like
while before the change, read blocks were of size 4096. Other than that, I haven't done any testing yet. So, no guarantees whatsoever (!) that it'll work in every respect... — just something to play with at your own risk. Good luck!
In Section
Seekers of Perl Wisdom
|
|